lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8Eao1l0qRVLKK7e@debian.me>
Date:   Fri, 13 Jan 2023 15:47:31 +0700
From:   Bagas Sanjaya <bagasdotme@...il.com>
To:     yang.yang29@....com.cn, akpm@...ux-foundation.org,
        hannes@...xchg.org, willy@...radead.org
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, iamjoonsoo.kim@....com, ran.xiaokai@....com.cn
Subject: Re: [PATCH linux-next v2] swap_state: update shadow_nodes for
 anonymous page

On Fri, Jan 13, 2023 at 03:50:45PM +0800, yang.yang29@....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

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ