[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7033e7a4-5d5f-7e7b-20af-ff1c85ec3b3a@oracle.com>
Date: Wed, 5 Jul 2023 13:25:56 -0700
From: Sidhartha Kumar <sidhartha.kumar@...cle.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org
Subject: Re: [PATCH v2 4/4] mm/memory: convert do_read_fault() to use folios
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@...cle.com>
>
> Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.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;
>
>
Powered by blists - more mailing lists