linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Usama Arif <usamaarif642@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org,
	yosryahmed@google.com, nphamcs@gmail.com,
	chengming.zhou@linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH v2 1/2] mm: clear pte for folios that are zero filled
Date: Tue, 4 Jun 2024 13:42:25 +0100	[thread overview]
Message-ID: <7253d276-1bbc-47a8-a5c3-c7c8ec43bab0@gmail.com> (raw)
In-Reply-To: <Zl8GDlOSh56VgRtj@casper.infradead.org>


On 04/06/2024 13:18, Matthew Wilcox wrote:
> On Tue, Jun 04, 2024 at 11:58:24AM +0100, Usama Arif wrote:
>> +++ b/mm/rmap.c
>> @@ -1819,96 +1819,101 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma,
>>   			 */
>>   			dec_mm_counter(mm, mm_counter(folio));
>>   		} else if (folio_test_anon(folio)) {
>> -			swp_entry_t entry = page_swap_entry(subpage);
>> -			pte_t swp_pte;
>> -			/*
>> -			 * Store the swap location in the pte.
>> -			 * See handle_pte_fault() ...
>> -			 */
>> -			if (unlikely(folio_test_swapbacked(folio) !=
>> -					folio_test_swapcache(folio))) {
>> +			if (flags & TTU_ZERO_FOLIO) {
>> +				pte_clear(mm, address, pvmw.pte);
>> +				dec_mm_counter(mm, MM_ANONPAGES);
>> +			} else {
> This is very hard to review.  Is what you've done the same as:
>
> 			if (flags & TTU_ZERO_FOLIO) {
> 				pte_clear(mm, address, pvmw.pte);
> 				dec_mm_counter(mm, MM_ANONPAGES);
> 				goto discard;
> 			}
>
> ?  I genuinely can't tell.
>
Yes, thats what I am doing, will switch to above in next revision, Thanks!


  reply	other threads:[~2024-06-04 12:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04 10:58 [PATCH v2 0/2] " Usama Arif
2024-06-04 10:58 ` [PATCH v2 1/2] " Usama Arif
2024-06-04 12:18   ` Matthew Wilcox
2024-06-04 12:42     ` Usama Arif [this message]
2024-06-04 12:30   ` David Hildenbrand
2024-06-04 12:43     ` David Hildenbrand
2024-06-07 10:24       ` Usama Arif
2024-06-07 11:16         ` David Hildenbrand
2024-06-05  8:55   ` Shakeel Butt
2024-06-07 10:40     ` Usama Arif
2024-06-04 10:58 ` [PATCH v2 2/2] mm: remove code to handle same filled pages Usama Arif

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=7253d276-1bbc-47a8-a5c3-c7c8ec43bab0@gmail.com \
    --to=usamaarif642@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=willy@infradead.org \
    --cc=yosryahmed@google.com \
    /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