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: <47e78c2c-1d58-4ef6-8c41-f233f6778edc@redhat.com>
Date: Fri, 5 Apr 2024 09:24:21 +0200
From: David Hildenbrand <david@...hat.com>
To: alexs@...nel.org, Matthew Wilcox <willy@...radead.org>,
 Andrea Arcangeli <aarcange@...hat.com>,
 Izik Eidus <izik.eidus@...ellosystems.com>,
 Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, ryncsn@...il.com
Cc: Hugh Dickins <hughd@...gle.com>, Chris Wright <chrisw@...s-sol.org>
Subject: Re: [PATCH v3 02/14] mm/ksm: use folio in remove_rmap_item_from_tree

On 25.03.24 13:48, alexs@...nel.org wrote:
> From: "Alex Shi (tencent)" <alexs@...nel.org>
> 
> To save 2 compound_head calls.
> 
> Signed-off-by: Alex Shi (tencent) <alexs@...nel.org>
> Cc: Izik Eidus <izik.eidus@...ellosystems.com>
> Cc: Matthew Wilcox <willy@...radead.org>
> Cc: Andrea Arcangeli <aarcange@...hat.com>
> Cc: Hugh Dickins <hughd@...gle.com>
> Cc: Chris Wright <chrisw@...s-sol.org>
> ---
>   mm/ksm.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/ksm.c b/mm/ksm.c
> index ac080235b002..ea3dabf71e47 100644
> --- a/mm/ksm.c
> +++ b/mm/ksm.c
> @@ -1006,16 +1006,16 @@ static void remove_rmap_item_from_tree(struct ksm_rmap_item *rmap_item)
>   {
>   	if (rmap_item->address & STABLE_FLAG) {
>   		struct ksm_stable_node *stable_node;
> -		struct page *page;
> +		struct folio *folio;
>   
>   		stable_node = rmap_item->head;
> -		page = get_ksm_page(stable_node, GET_KSM_PAGE_LOCK);
> -		if (!page)
> +		folio = ksm_get_folio(stable_node, GET_KSM_PAGE_LOCK);
> +		if (!folio)
>   			goto out;
>   
>   		hlist_del(&rmap_item->hlist);
> -		unlock_page(page);
> -		put_page(page);
> +		folio_unlock(folio);
> +		folio_put(folio);
>   
>   		if (!hlist_empty(&stable_node->hlist))
>   			ksm_pages_sharing--;

Reviewed-by: David Hildenbrand <david@...hat.com>

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ