linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sidhartha Kumar <sidhartha.kumar@oracle.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH v2 4/4] mm/memory: convert do_read_fault() to use folios
Date: Wed, 5 Jul 2023 13:25:56 -0700	[thread overview]
Message-ID: <7033e7a4-5d5f-7e7b-20af-ff1c85ec3b3a@oracle.com> (raw)
In-Reply-To: <ZKXQNa7mikRJWO2M@casper.infradead.org>

On 7/5/23 1:19 PM, Matthew Wilcox wrote:
> On Wed, Jul 05, 2023 at 12:43:35PM -0700, Sidhartha Kumar wrote:
>> Saves one implicit call to compound_head()
>>
>> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> 
> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> 
>> @@ -4543,10 +4544,12 @@ static vm_fault_t do_read_fault(struct vm_fault *vmf)
>>   	if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY)))
>>   		return ret;
>>   
>> +	folio = page_folio(vmf->page);
> 
> Why not move this down to after the call to finish_fault()?  The
> compiler should be able to do a better job with that; it may have to
> spill it to the stack to preserve it over the function call.
> 

I just noticed that the page inside the vmf was being used in 
finish_fault() so it would stable enough to do the folio conversion 
before. I can move it after for compiler reasons.

>>   	ret |= finish_fault(vmf);
>> -	unlock_page(vmf->page);
>> +	folio_unlock(folio);
>>   	if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY)))
>> -		put_page(vmf->page);
>> +		folio_put(folio);
>>   	return ret;
> 
> 



  reply	other threads:[~2023-07-05 20:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 19:43 [PATCH v2 1/4] mm/memory: convert do_page_mkwrite() " Sidhartha Kumar
2023-07-05 19:43 ` [PATCH v2 2/4] mm/memory: convert wp_page_shared() " Sidhartha Kumar
2023-07-05 20:03   ` Matthew Wilcox
2023-07-05 19:43 ` [PATCH v2 3/4] mm/memory: convert do_shared_fault() to folios Sidhartha Kumar
2023-07-05 20:13   ` Matthew Wilcox
2023-07-05 20:16     ` Sidhartha Kumar
2023-07-05 20:19       ` Matthew Wilcox
2023-07-05 19:43 ` [PATCH v2 4/4] mm/memory: convert do_read_fault() to use folios Sidhartha Kumar
2023-07-05 20:19   ` Matthew Wilcox
2023-07-05 20:25     ` Sidhartha Kumar [this message]
2023-07-05 19:52 ` [PATCH v2 1/4] mm/memory: convert do_page_mkwrite() " 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=7033e7a4-5d5f-7e7b-20af-ff1c85ec3b3a@oracle.com \
    --to=sidhartha.kumar@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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