linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: yang.yang29@zte.com.cn, akpm@linux-foundation.org,
	hannes@cmpxchg.org, willy@infradead.org
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, iamjoonsoo.kim@lge.com,
	ran.xiaokai@zte.com.cn
Subject: Re: [PATCH linux-next v2] swap_state: update shadow_nodes for anonymous page
Date: Fri, 13 Jan 2023 15:47:31 +0700	[thread overview]
Message-ID: <Y8Eao1l0qRVLKK7e@debian.me> (raw)
In-Reply-To: <202301131550455361823@zte.com.cn>

[-- Attachment #1: Type: text/plain, Size: 1712 bytes --]

On Fri, Jan 13, 2023 at 03:50:45PM +0800, yang.yang29@zte.com.cn wrote:
> This patch updates shadow_nodes of anonymous page when swap
> cache is add or delete.

By what?

> diff --git a/mm/swap_state.c b/mm/swap_state.c
> index cb9aaa00951d..7a003d8abb37 100644
> --- a/mm/swap_state.c
> +++ b/mm/swap_state.c
> @@ -94,6 +94,8 @@ int add_to_swap_cache(struct folio *folio, swp_entry_t entry,
>  	unsigned long i, nr = folio_nr_pages(folio);
>  	void *old;
> 
> +	xas_set_update(&xas, workingset_update_node);
> +
>  	VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
>  	VM_BUG_ON_FOLIO(folio_test_swapcache(folio), folio);
>  	VM_BUG_ON_FOLIO(!folio_test_swapbacked(folio), folio);
> @@ -145,6 +147,8 @@ void __delete_from_swap_cache(struct folio *folio,
>  	pgoff_t idx = swp_offset(entry);
>  	XA_STATE(xas, &address_space->i_pages, idx);
> 
> +	xas_set_update(&xas, workingset_update_node);
> +
>  	VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
>  	VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio);
>  	VM_BUG_ON_FOLIO(folio_test_writeback(folio), folio);
> @@ -252,6 +256,8 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin,
>  		struct address_space *address_space = swap_address_space(entry);
>  		XA_STATE(xas, &address_space->i_pages, curr);
> 
> +		xas_set_update(&xas, workingset_update_node);
> +
>  		xa_lock_irq(&address_space->i_pages);
>  		xas_for_each(&xas, old, end) {
>  			if (!xa_is_value(old))

Adding xas_set_update() call?

In any case, please explain what you are doing above in imperative mood
(no "This patch does foo" but "Do foo" instead).

Thanks.

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-01-13  8:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13  7:50 yang.yang29
2023-01-13  8:47 ` Bagas Sanjaya [this message]
2023-01-13 13:59   ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8Eao1l0qRVLKK7e@debian.me \
    --to=bagasdotme@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ran.xiaokai@zte.com.cn \
    --cc=willy@infradead.org \
    --cc=yang.yang29@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox