diff --git a/include/linux/swap.h b/include/linux/swap.h index 9d7ec92874d3..f5eb65656721 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -217,7 +217,9 @@ enum { SWP_AREA_DISCARD = (1 << 9), /* single-time swap area discards */ SWP_PAGE_DISCARD = (1 << 10), /* freed swap page-cluster discards */ SWP_STABLE_WRITES = (1 << 11), /* no overwrite PG_writeback pages */ - SWP_SYNCHRONOUS_IO = (1 << 12), /* synchronous IO is efficient */ + __SWP_READ_SYNCHRONOUS_IO = (1 << 12), /* synchronous read IO is efficient */ + __SWP_WRITE_SYNCHRONOUS_IO = (1 << 13), /* synchronous write IO is efficient */ + SWP_SYNCHRONOUS_IO = (__SWP_READ_SYNCHRONOUS_IO | __SWP_WRITE_SYNCHRONOUS_IO), /* add others here before... */ SWP_SCANNING = (1 << 14), /* refcount in scan_swap_map */ }; diff --git a/mm/page_io.c b/mm/page_io.c index 01749b99fb54..3880256fb1fd 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -463,10 +463,10 @@ void __swap_writepage(struct folio *folio, struct writeback_control *wbc) swap_writepage_fs(folio, wbc); /* * ->flags can be updated non-atomicially (scan_swap_map_slots), - * but that will never affect SWP_SYNCHRONOUS_IO, so the data_race + * but that will never affect __SWP_WRITE_SYNCHRONOUS_IO, so the data_race * is safe. */ - else if (data_race(sis->flags & SWP_SYNCHRONOUS_IO)) + else if (data_race(sis->flags & __SWP_WRITE_SYNCHRONOUS_IO)) swap_writepage_bdev_sync(folio, wbc, sis); else swap_writepage_bdev_async(folio, wbc, sis);