Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd6cbd44 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm: vmscan: move dirty pages out of the way until they're flushed"

parents 20fa9d7f 6b25f41c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -50,6 +50,13 @@ static __always_inline void add_page_to_lru_list(struct page *page,
	list_add(&page->lru, &lruvec->lists[lru]);
}

static __always_inline void add_page_to_lru_list_tail(struct page *page,
				struct lruvec *lruvec, enum lru_list lru)
{
	update_lru_size(lruvec, lru, page_zonenum(page), hpage_nr_pages(page));
	list_add_tail(&page->lru, &lruvec->lists[lru]);
}

static __always_inline void del_page_from_lru_list(struct page *page,
				struct lruvec *lruvec, enum lru_list lru)
{
+5 −4
Original line number Diff line number Diff line
@@ -208,9 +208,10 @@ static void pagevec_move_tail_fn(struct page *page, struct lruvec *lruvec,
{
	int *pgmoved = arg;

	if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) {
		enum lru_list lru = page_lru_base_type(page);
		list_move_tail(&page->lru, &lruvec->lists[lru]);
	if (PageLRU(page) && !PageUnevictable(page)) {
		del_page_from_lru_list(page, lruvec, page_lru(page));
		ClearPageActive(page);
		add_page_to_lru_list_tail(page, lruvec, page_lru(page));
		(*pgmoved)++;
	}
}
@@ -234,7 +235,7 @@ static void pagevec_move_tail(struct pagevec *pvec)
 */
void rotate_reclaimable_page(struct page *page)
{
	if (!PageLocked(page) && !PageDirty(page) && !PageActive(page) &&
	if (!PageLocked(page) && !PageDirty(page) &&
	    !PageUnevictable(page) && PageLRU(page)) {
		struct pagevec *pvec;
		unsigned long flags;
+12 −3
Original line number Diff line number Diff line
@@ -1058,6 +1058,15 @@ static unsigned long shrink_page_list(struct list_head *page_list,
		 *    throttling so we could easily OOM just because too many
		 *    pages are in writeback and there is nothing else to
		 *    reclaim. Wait for the writeback to complete.
		 *
		 * In cases 1) and 2) we activate the pages to get them out of
		 * the way while we continue scanning for clean pages on the
		 * inactive list and refilling from the active list. The
		 * observation here is that waiting for disk writes is more
		 * expensive than potentially causing reloads down the line.
		 * Since they're marked for immediate reclaim, they won't put
		 * memory pressure on the cache working set any longer than it
		 * takes to write them to disk.
		 */
		if (PageWriteback(page)) {
			/* Case 1 above */
@@ -1065,7 +1074,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
			    PageReclaim(page) &&
			    (pgdat && test_bit(PGDAT_WRITEBACK, &pgdat->flags))) {
				nr_immediate++;
				goto keep_locked;
				goto activate_locked;

			/* Case 2 above */
			} else if (sane_reclaim(sc) ||
@@ -1083,7 +1092,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
				 */
				SetPageReclaim(page);
				nr_writeback++;
				goto keep_locked;
				goto activate_locked;

			/* Case 3 above */
			} else {
@@ -1175,7 +1184,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
				inc_node_page_state(page, NR_VMSCAN_IMMEDIATE);
				SetPageReclaim(page);

				goto keep_locked;
				goto activate_locked;
			}

			if (references == PAGEREF_RECLAIM_CLEAN)