lkml.org 
[lkml]   [2017]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 14/20] mm: Provide speculative fault infrastructure
From
Date
On 08/30/2017 03:02 PM, Laurent Dufour wrote:
> On 30/08/2017 07:58, Peter Zijlstra wrote:
>> On Wed, Aug 30, 2017 at 10:33:50AM +0530, Anshuman Khandual wrote:
>>> diff --git a/mm/filemap.c b/mm/filemap.c
>>> index a497024..08f3042 100644
>>> --- a/mm/filemap.c
>>> +++ b/mm/filemap.c
>>> @@ -1181,6 +1181,18 @@ int __lock_page_killable(struct page *__page)
>>> int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
>>> unsigned int flags)
>>> {
>>> + if (flags & FAULT_FLAG_SPECULATIVE) {
>>> + if (flags & FAULT_FLAG_KILLABLE) {
>>> + int ret;
>>> +
>>> + ret = __lock_page_killable(page);
>>> + if (ret)
>>> + return 0;
>>> + } else
>>> + __lock_page(page);
>>> + return 1;
>>> + }
>>> +
>>> if (flags & FAULT_FLAG_ALLOW_RETRY) {
>>> /*
>>> * CAUTION! In this case, mmap_sem is not released
>>
>> Yeah, that looks right.
>
> Hum, I'm wondering if FAULT_FLAG_RETRY_NOWAIT should be forced in the
> speculative path in that case to match the semantics of
> __lock_page_or_retry().

Doing that would force us to have another retry through classic fault
path wasting all the work done till now through SPF. Hence it may be
better to just wait, get the lock here and complete the fault. Peterz,
would you agree ? Or we should do as suggested by Laurent. More over,
forcing FAULT_FLAG_RETRY_NOWAIT on FAULT_FLAG_SPECULTIVE at this point
would look like a hack.

\
 
 \ /
  Last update: 2017-08-31 08:55    [W:0.078 / U:2.020 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site