[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ccd527b4-de71-82a6-d86a-2d3abc75d2b9@suse.cz>
Date: Tue, 18 May 2021 12:45:24 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
akpm@...ux-foundation.org
Cc: linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>,
Jeff Layton <jlayton@...nel.org>
Subject: Re: [PATCH v10 22/33] mm/filemap: Add __folio_lock_or_retry
On 5/18/21 12:38 PM, Vlastimil Babka wrote:
>> --- a/mm/filemap.c
>> +++ b/mm/filemap.c
>> @@ -1623,20 +1623,18 @@ static int __folio_lock_async(struct folio *folio, struct wait_page_queue *wait)
>>
>> /*
>> * Return values:
>> - * 1 - page is locked; mmap_lock is still held.
>> - * 0 - page is not locked.
>> + * 1 - folio is locked; mmap_lock is still held.
>> + * 0 - folio is not locked.
>> * mmap_lock has been released (mmap_read_unlock(), unless flags had both
>> * FAULT_FLAG_ALLOW_RETRY and FAULT_FLAG_RETRY_NOWAIT set, in
>> * which case mmap_lock is still held.
>> *
>> * If neither ALLOW_RETRY nor KILLABLE are set, will always return 1
>> - * with the page locked and the mmap_lock unperturbed.
>> + * with the folio locked and the mmap_lock unperturbed.
>> */
>> -int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
>> +int __folio_lock_or_retry(struct folio *folio, struct mm_struct *mm,
>> unsigned int flags)
>> {
>> - struct folio *folio = page_folio(page);
>> -
>> if (fault_flag_allow_retry_first(flags)) {
>> /*
>> * CAUTION! In this case, mmap_lock is not released
>
> A bit later in this branch, 'page' is accessed, but it no longer exists. And
> thus as expected, it doesn't compile. Assuming it's fixed later, but
> bisectability etc...
Also, the switch from 'page' to &folio->page in there should probably have been
done already in "[PATCH v10 20/33] mm/filemap: Add folio_lock_killable", not in
this patch?
Powered by blists - more mailing lists