Commit 7adc97bc authored by Andrew Morton's avatar Andrew Morton
Browse files

mm/vmscan.c:shrink_folio_list(): save a tabstop



We have some needlessly deep indentation in this huge function due to

	if (expr1) {
		if (expr2) {
			...
		}
	}

Convert this to

	if (expr1 && expr2) {
		...
	}

Also, reflow that big block comment to fit in 80 cols.

Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: Wei Xu <weixugc@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent bf3480d7
Loading
Loading
Loading
Loading
+49 −49
Original line number Diff line number Diff line
@@ -1276,8 +1276,8 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
		 * Try to allocate it some swap space here.
		 * Lazyfree folio could be freed directly
		 */
		if (folio_test_anon(folio) && folio_test_swapbacked(folio)) {
			if (!folio_test_swapcache(folio)) {
		if (folio_test_anon(folio) && folio_test_swapbacked(folio) &&
				!folio_test_swapcache(folio)) {
			if (!(sc->gfp_mask & __GFP_IO))
				goto keep_locked;
			if (folio_maybe_dma_pinned(folio))
@@ -1316,19 +1316,19 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
					goto activate_locked_split;
			}
			/*
				 * Normally the folio will be dirtied in unmap because its
				 * pte should be dirty. A special case is MADV_FREE page. The
				 * page's pte could have dirty bit cleared but the folio's
				 * SwapBacked flag is still set because clearing the dirty bit
				 * and SwapBacked flag has no lock protected. For such folio,
				 * unmap will not set dirty bit for it, so folio reclaim will
				 * not write the folio out. This can cause data corruption when
				 * the folio is swapped in later. Always setting the dirty flag
				 * for the folio solves the problem.
			 * Normally the folio will be dirtied in unmap because
			 * its pte should be dirty. A special case is MADV_FREE
			 * page. The page's pte could have dirty bit cleared but
			 * the folio's SwapBacked flag is still set because
			 * clearing the dirty bit and SwapBacked flag has no
			 * lock protected. For such folio, unmap will not set
			 * dirty bit for it, so folio reclaim will not write the
			 * folio out. This can cause data corruption when the
			 * folio is swapped in later. Always setting the dirty
			 * flag for the folio solves the problem.
			 */
			folio_mark_dirty(folio);
		}
		}

		/*
		 * If the folio was split above, the tail pages will make