lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 24 Jun 2019 15:04:21 +0000
From:   Song Liu <songliubraving@...com>
To:     "Kirill A. Shutemov" <kirill@...temov.name>
CC:     "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "matthew.wilcox@...cle.com" <matthew.wilcox@...cle.com>,
        "kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
        Kernel Team <Kernel-team@...com>,
        "william.kucharski@...cle.com" <william.kucharski@...cle.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "hdanton@...a.com" <hdanton@...a.com>
Subject: Re: [PATCH v7 5/6] mm,thp: add read-only THP support for (non-shmem)
 FS



> On Jun 24, 2019, at 7:54 AM, Kirill A. Shutemov <kirill@...temov.name> wrote:
> 
> On Mon, Jun 24, 2019 at 02:42:13PM +0000, Song Liu wrote:
>> 
>> 
>>> On Jun 24, 2019, at 7:27 AM, Kirill A. Shutemov <kirill@...temov.name> wrote:
>>> 
>>> On Mon, Jun 24, 2019 at 02:01:05PM +0000, Song Liu wrote:
>>>>>> @@ -1392,6 +1403,23 @@ static void collapse_file(struct mm_struct *mm,
>>>>>> 				result = SCAN_FAIL;
>>>>>> 				goto xa_unlocked;
>>>>>> 			}
>>>>>> +		} else if (!page || xa_is_value(page)) {
>>>>>> +			xas_unlock_irq(&xas);
>>>>>> +			page_cache_sync_readahead(mapping, &file->f_ra, file,
>>>>>> +						  index, PAGE_SIZE);
>>>>>> +			lru_add_drain();
>>>>> 
>>>>> Why?
>>>> 
>>>> isolate_lru_page() is likely to fail if we don't drain the pagevecs. 
>>> 
>>> Please add a comment.
>> 
>> Will do. 
>> 
>>> 
>>>>>> +			page = find_lock_page(mapping, index);
>>>>>> +			if (unlikely(page == NULL)) {
>>>>>> +				result = SCAN_FAIL;
>>>>>> +				goto xa_unlocked;
>>>>>> +			}
>>>>>> +		} else if (!PageUptodate(page)) {
>>>>> 
>>>>> Maybe we should try wait_on_page_locked() here before give up?
>>>> 
>>>> Are you referring to the "if (!PageUptodate(page))" case? 
>>> 
>>> Yes.
>> 
>> I think this case happens when another thread is reading the page in. 
>> I could not think of a way to trigger this condition for testing. 
>> 
>> On the other hand, with current logic, we will retry the page on the 
>> next scan, so I guess this is OK. 
> 
> What I meant that calling wait_on_page_locked() on !PageUptodate() page
> will likely make it up-to-date and we don't need to SCAN_FAIL the attempt.
> 

Yeah, I got the point. My only concern is that I don't know how to 
reliably trigger this case for testing. I can try to trigger it. But I 
don't know whether it will happen easily. 

Thanks,
Song




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ