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: <87illgky5e.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date:   Thu, 22 Sep 2022 09:15:09 +0800
From:   "Huang, Ying" <ying.huang@...el.com>
To:     Zi Yan <ziy@...dia.com>
Cc:     <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Yang Shi <shy828301@...il.com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Oscar Salvador <osalvador@...e.de>,
        "Matthew Wilcox" <willy@...radead.org>
Subject: Re: [RFC 2/6] mm/migrate_pages: split unmap_and_move() to _unmap()
 and _move()

Zi Yan <ziy@...dia.com> writes:

> On 21 Sep 2022, at 2:06, Huang Ying wrote:
>
>> This is a preparation patch to batch the page unmapping and moving
>> for the normal pages and THP.
>>
>> In this patch, unmap_and_move() is split to migrate_page_unmap() and
>> migrate_page_move().  So, we can batch _unmap() and _move() in
>> different loops later.  To pass some information between unmap and
>> move, the original unused newpage->mapping and newpage->private are
>> used.
>>
>> Signed-off-by: "Huang, Ying" <ying.huang@...el.com>
>> Cc: Zi Yan <ziy@...dia.com>
>> Cc: Yang Shi <shy828301@...il.com>
>> Cc: Baolin Wang <baolin.wang@...ux.alibaba.com>
>> Cc: Oscar Salvador <osalvador@...e.de>
>> Cc: Matthew Wilcox <willy@...radead.org>
>> ---
>>  mm/migrate.c | 164 ++++++++++++++++++++++++++++++++++++++-------------
>>  1 file changed, 122 insertions(+), 42 deletions(-)
>>
>> diff --git a/mm/migrate.c b/mm/migrate.c
>> index 117134f1c6dc..4a81e0bfdbcd 100644
>> --- a/mm/migrate.c
>> +++ b/mm/migrate.c
>> @@ -976,13 +976,32 @@ static int move_to_new_folio(struct folio *dst, struct folio *src,
>>  	return rc;
>>  }
>>
>> -static int __unmap_and_move(struct page *page, struct page *newpage,
>> +static void __migrate_page_record(struct page *newpage,
>> +				  int page_was_mapped,
>> +				  struct anon_vma *anon_vma)
>> +{
>> +	newpage->mapping = (struct address_space *)anon_vma;
>> +	newpage->private = page_was_mapped;
>> +}
>> +
>> +static void __migrate_page_extract(struct page *newpage,
>> +				   int *page_was_mappedp,
>> +				   struct anon_vma **anon_vmap)
>> +{
>> +	*anon_vmap = (struct anon_vma *)newpage->mapping;
>> +	*page_was_mappedp = newpage->private;
>> +	newpage->mapping = NULL;
>> +	newpage->private = 0;
>> +}
>> +
>> +#define MIGRATEPAGE_UNMAP		1
>
> It is better to move this to migrate.h with MIGRATEPAGE_SUCCESS and
> make them an enum.

Make sense!  Will do this in the next version.

Best Regards,
Huang, Ying

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ