All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Sidhartha Kumar <sidhartha.kumar@oracle.com>
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 21:19:01 +0100	[thread overview]
Message-ID: <ZKXQNa7mikRJWO2M@casper.infradead.org> (raw)
In-Reply-To: <20230705194335.273790-4-sidhartha.kumar@oracle.com>

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.

>  	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:19 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() to use folios 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 [this message]
2023-07-05 20:25     ` Sidhartha Kumar
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=ZKXQNa7mikRJWO2M@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sidhartha.kumar@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.