mm: Clean up and document fault and RETRY mmap_sem
Subsystems (3)
cover mm: Clean up and document fault and RETRY mmap_sem
On IRC, Russell King noticed that the code in arch/x86/mm/fault.c looked buggy with the retry loop and retaking the mmap_sem. But with further investigation it seems to be correct, but now handle_mm_fault() has subtle locking with the mmap_sem depending on what flags are set.
Unfortunately, there's no good comments about what is going on in the code. Doing various git blame, git show, I dug up the history and cleaned up the RETRY_NOWAIT and added documentation to the handle_mm_fault().
Steven Rostedt (2):
mm: Remove use of ALLOW_RETRY when RETRY_NOWAIT is set
mm: Document handle_mm_fault()
----
include/linux/mm.h | 4 ++-- mm/filemap.c | 14 +++++++------- mm/memory.c | 24 +++++++++++++++++++++--- 3 files changed, 30 insertions(+), 12 deletions(-)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 1/2 mm: Remove use of ALLOW_RETRY when RETRY_NOWAIT is set
From: Steven Rostedt <[email protected]>
The only user of FAULT_FLAG_RETRY_NOWAIT also sets the FAULT_FLAG_ALLOW_RETRY flag. This makes the check in the __lock_page_or_retry redundant as it checks the RETRY_NOWAIT just after checking ALLOW_RETRY and then returns if it is set. The FAULT_FLAG_ALLOW_RETRY does not make any other difference in this path.
Setting both and then ignoring one is quite confusing, especially since this code has very subtle locking issues when it comes to the mmap_sem.
Only set the RETRY_WAIT flag and have that do the necessary work instead of confusing reviewers of this code by setting ALLOW_RETRY and not releasing the mmap_sem.
--- include/linux/mm.h | 4 ++-- mm/filemap.c | 14 +++++++------- mm/memory.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-)
include/linux/mm.h +2 -2
@@ -151,8 +151,8 @@ extern pgprot_t protection_map[16];#define FAULT_FLAG_WRITE 0x01/* Fault was a write access */ #define FAULT_FLAG_NONLINEAR 0x02/* Fault was via a nonlinear mapping */ #define FAULT_FLAG_MKWRITE 0x04/* Fault was mkwrite of existing pte */ -#define FAULT_FLAG_ALLOW_RETRY 0x08/* Retry fault if blocking */ -#define FAULT_FLAG_RETRY_NOWAIT 0x10/* Don't drop mmap_sem and wait when retrying */ +#define FAULT_FLAG_ALLOW_RETRY 0x08/* Retry fault if blocking (drops mmap_sem) */ +#define FAULT_FLAG_RETRY_NOWAIT 0x10/* Wait when retrying (don't drop mmap_sem) */ #define FAULT_FLAG_KILLABLE 0x20/* The fault task is in SIGKILL killable region */ /*
mm/filemap.c +7 -7
@@ -665,14 +665,14 @@ EXPORT_SYMBOL_GPL(__lock_page_killable);int __lock_page_or_retry (struct page *page,struct mm_struct *mm,unsigned int flags) { -if (flags &FAULT_FLAG_ALLOW_RETRY ) { -/* -* CAUTION! In this case, mmap_sem is not released -* even though return 0. -*/ -if (flags &FAULT_FLAG_RETRY_NOWAIT ) -return 0 ; +/* +* Don't drop mmap_sem if FAULT_FLAG_RETRY_NOWAIT is +* set, even if FAULT_FLAG_ALLOW_RETRY is set. +*/ +if (flags &FAULT_FLAG_RETRY_NOWAIT ) +return 0 ; +if (flags &FAULT_FLAG_ALLOW_RETRY ) {up_read (&mm->mmap_sem);if (flags &FAULT_FLAG_KILLABLE )wait_on_page_locked_killable (page);
mm/memory.c +1 -1
@@ -1742,7 +1742,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,if (nonblocking) fault_flags |=FAULT_FLAG_ALLOW_RETRY ;if (foll_flags &FOLL_NOWAIT ) - fault_flags |= (FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_RETRY_NOWAIT ); + fault_flags |=FAULT_FLAG_RETRY_NOWAIT ; ret =handle_mm_fault (mm, vma, start, fault_flags);
Signature · 9 lines
1.7.5.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 1/2] mm: Remove use of ALLOW_RETRY when RETRY_NOWAIT is set
Quoted 20 lines · Steven Rostedt
From: Steven Rostedt <[email protected]>
The only user of
FAULT_FLAG_RETRY_NOWAITalso sets theFAULT_FLAG_ALLOW_RETRYflag. This makes the check in the__lock_page_or_retryredundant as it checks theRETRY_NOWAITjust after checkingALLOW_RETRYand then returns if it is set. TheFAULT_FLAG_ALLOW_RETRYdoes not make any other difference in this path.Setting both and then ignoring one is quite confusing, especially since this code has very subtle locking issues when it comes to the
mmap_sem.Only set the
RETRY_WAITflag and have that do the necessary work instead of confusing reviewers of this code by settingALLOW_RETRYand not releasing themmap_sem.
include/linux/mm.h extern pgprot_t protection_map[16]; · line 155
Quoted 7 lines
include/linux/mm.h +2
-2@@ -151,8 +151,8 @@ extern pgprot_t protection_map[16]; #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ -#define FAULT_FLAG_ALLOW_RETRY 0x08/* Retry fault if blocking */ -#define FAULT_FLAG_RETRY_NOWAIT 0x10/* Don't drop mmap_sem and wait when retrying */ +#define FAULT_FLAG_ALLOW_RETRY 0x08/* Retry fault if blocking (drops mmap_sem) */ +#define FAULT_FLAG_RETRY_NOWAIT 0x10/* Wait when retrying (don't drop mmap_sem) */
You want to say "DONT wait when retrying" here...
Also - you argued higher up that having both flags set at once is confusing, but I find it equally confusing to pass a flag to specify you don't want to wait on retry if the flag that allows retry is not set. I think the confusion comes from the way the nowait semantics got bolted on the retry code for virtualization, even though (if I understand the virtualization use case correctly) they dont actually want to retry there, they just want to give up without blocking.
Would the following proposal make more sense to you ?
FAULT_FLAG_ALLOW_ASYNC: allow returning a VM_FAULT_ASYNC error code if the page can't be obtained immediately (major fault).FAULT_FLAG_ASYNC_WAIT: before returning VM_FAULT_ASYNC, drop the mmap_sem and wait for major fault to complete.
existing uses of FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_RETRY_NOWAIT become FAULT_FLAG_ASYNC
existing uses of FAULT_FLAG_ALLOW_RETRY alone become FAULT_FLAG_ASYNC | FAULT_FLAG_ASYNC_WAIT
existing uses of VM_FAULT_RETRY become VM_FAULT_ASYNC
This may also help your documentation proposal since the flags would now work together rather than having one be an exception to the other.
Signature · 9 lines
Michel "Walken" Lespinasse A program is never fully debugged until the last user dies. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 1/2] mm: Remove use of ALLOW_RETRY when RETRY_NOWAIT is set
Quoted 18 lines · Michel Lespinasse
Quoted 17 lines · Steven Rostedt
From: Steven Rostedt <[email protected]>
The only user of
FAULT_FLAG_RETRY_NOWAITalso sets theFAULT_FLAG_ALLOW_RETRYflag. This makes the check in the__lock_page_or_retryredundant as it checks theRETRY_NOWAITjust after checkingALLOW_RETRYand then returns if it is set. TheFAULT_FLAG_ALLOW_RETRYdoes not make any other difference in this path.Setting both and then ignoring one is quite confusing, especially since this code has very subtle locking issues when it comes to the
mmap_sem.Only set the
RETRY_WAITflag and have that do the necessary work instead of confusing reviewers of this code by settingALLOW_RETRYand not releasing themmap_sem.
Quoted 12 lines
include/linux/mm.h extern pgprot_t protection_map[16]; · line 155
Quoted 10 lines
include/linux/mm.h +2
-2@@ -151,8 +151,8 @@ extern pgprot_t protection_map[16];#define FAULT_FLAG_WRITE 0x01/* Fault was a write access */ #define FAULT_FLAG_NONLINEAR 0x02/* Fault was via a nonlinear mapping */ #define FAULT_FLAG_MKWRITE 0x04/* Fault was mkwrite of existing pte */ -#define FAULT_FLAG_ALLOW_RETRY 0x08/* Retry fault if blocking */ -#define FAULT_FLAG_RETRY_NOWAIT 0x10/* Don't drop mmap_sem and wait when retrying */ +#define FAULT_FLAG_ALLOW_RETRY 0x08/* Retry fault if blocking (drops mmap_sem) */ +#define FAULT_FLAG_RETRY_NOWAIT 0x10/* Wait when retrying (don't drop mmap_sem) */ You want to say "DONT wait when retrying" here...
Yeah, I thought that was weird in the comment. Heh, rereading the original comment I see it meant "don't drop nor wait" where I thought it meant "Don't drop mmap_sem and then wait when retrying". That needs to be fixed :)
Quoted 5 lines
Also - you argued higher up that having both flags set at once is confusing, but I find it equally confusing to pass a flag to specify you don't want to wait on retry if the flag that allows retry is not set.
Hmm, I understand. The main issue I have with all these flags is the locking. I really don't care about the semantics for retry and such. What I care about is this dropping of the mmap_sem. It is very confusing to understand when it is dropped or not.
Quoted 4 lines
I think the confusion comes from the way the nowait semantics got
bolted on the retry code for virtualization, even though (if I understand the virtualization use case correctly) they dont actually want to retry there, they just want to give up without blocking.
Right.
Quoted 8 lines
Would the following proposal make more sense to you ?
FAULT_FLAG_ALLOW_ASYNC: allow returning aVM_FAULT_ASYNCerror code if the page can't be obtained immediately (major fault).FAULT_FLAG_ASYNC_WAIT: before returningVM_FAULT_ASYNC, drop themmap_semand wait for major fault to complete.
Ug, I think that's worse. ASYNC to me is something that you enable and it will get back to you when done. Think AIO.
How about...
FAULT_FLAG_ALLOW_DROP_MMAP_SEM ?
and it returns VM_FAULT_DROPPED_MMAP_SEM if it drops it.
We could also have another flag:
FAULT_FLAG_NOWAIT_ON_PAGE
and it can return VM_FAULT_NOWAIT_PAGE if it failed to get the page lock and returned.
This to me documents exactly what is happening, and doesn't confuse kernel developers when they see handle_mm_fault() called, and then the code not releasing the mmap_sem.
If I saw in arch/x86/mm/fault.c:
if (fault & VM_FAULT_DROPPED_MMAP_SEM) {
/* Clear FAULT_FLAG_ALLOW_DROPPED_MMAP_SEM to avoid any risk
* of starvation. */
flags &= ~FAULT_FLAG_ALLOW_DROPPED_MMAP_SEM;
goto retry;
}There would have never been this confusion about why we are doing:
retry:
down_read(&mm->mmap_sem);
Without ever doing a up_read(&mm->mmap_sem);
Quoted 9 lines
existing uses of
FAULT_FLAG_ALLOW_RETRY|FAULT_FLAG_RETRY_NOWAITbecomeFAULT_FLAG_ASYNC
existing uses ofFAULT_FLAG_ALLOW_RETRYalone becomeFAULT_FLAG_ASYNC|FAULT_FLAG_ASYNC_WAIT
existing uses ofVM_FAULT_RETRYbecomeVM_FAULT_ASYNCThis may also help your documentation proposal since the flags would now work together rather than having one be an exception to the other.
I'm thinking they should still be separate. Just because they do things differently with the mmap_sem.
-- Steve
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 2/2 mm: Document handle_mm_fault()
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
The function handle_mm_fault() is long overdue for comments. Adding a kernel doc header for the function and explaining the subtle use of the flags with respect to mmap_sem will prove useful in the future when others work with this code.
Russell King noticed that the code in arch/x86/mm/fault.c looked buggy as the do_page_fault() code would grab the mmap_sem multiple times without letting it go. But it only did this when the handle_mm_fault() would return VM_FAULT_RETRY.
Examining the code and reading the git change logs, it was discovered that commit d065bd810b6deb67d4897a14bfe21f8eb526ba99
mm: retry page fault when blocking on disk transfer
added code to remove contention with the mmap_sem when the page_lock was being held for IO. As waiting on IO holding the mmap_sem can cause lots of contention between threads. The flag FAULT_FLAG_ALLOW_RETRY was added to let handle_mm_fault() know that it can safely release the mmap_sem.
Adding to the confusion here with handle_mm_fault(), another
commit 318b275fbca1ab9ec0862de71420e0e92c3d1aa7
mm: allow GUP to fail instead of waiting on a page
was added that would not release the mmap_sem, even if FAULT_FLAG_ALLOW_RETRY was set and the page_lock was not taken and VM_FAULT_RETRY was returned, if FAULT_FLAGS_RETRY_NOWAIT was set.
All of this is poorly documented and makes using or modifying handle_mm_fault() fragile. Documenting all of these subtle changes at the head of handle_mm_fault() should help future developers understand what is happening.
--- mm/memory.c | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-)
mm/memory.c +20 -2
@@ -3378,8 +3378,26 @@ unlock:return 0 ; } -/* -* By the time we get here, we already hold the mm semaphore +/** +* handle_mm_fault - main routine for handling page faults +* @mm: the mm_struct of the target address space +* @vma: vm_area_struct holding the applicable pages +* @address: the address that took the fault +* @flags: flags modifying lookup behaviour +* +* Must have @mm->mmap_sem held. +* +* Note: if @flags has FAULT_FLAG_ALLOW_RETRY set then the mmap_sem +* may be released if it failed to arquire the page_lock. If the +* mmap_sem is released then it will return VM_FAULT_RETRY set. +* This is to keep the time mmap_sem is held when the page_lock +* is taken for IO. +* Exception: If FAULT_FLAG_RETRY_NOWAIT is set, then it will +* not release the mmap_sem, but will still return VM_FAULT_RETRY +* if it failed to acquire the page_lock. +* This is for helping virtualization. See get_user_page_nowait(). +* +* Returns status flags based on the VM_FAULT_* flags in <linux/mm.h> */ int handle_mm_fault (struct mm_struct *mm,struct vm_area_struct *vma,unsigned long address,unsigned int flags)
Signature · 9 lines
1.7.5.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/2] mm: Document handle_mm_fault()
Quoted 15 lines · Steven Rostedt
(quoted diff) +0
-1- mm/memory.c | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-)mm/memory.c +1
-2@@ -3378,8 +3378,26 @@ unlock:return 0 ; } -/* -* By the time we get here, we already hold the mm semaphore +/**
mm/memory.c unlock: · line 3391
Quoted 10 lines
mm/memory.c +10
-0+* handle_mm_fault - main routine for handling page faults +* @mm: the mm_struct of the target address space +* @vma: vm_area_struct holding the applicable pages +* @address: the address that took the fault +* @flags: flags modifying lookup behaviour +* +* Must have @mm->mmap_sem held. +* +* Note: if @flags has FAULT_FLAG_ALLOW_RETRY set then the mmap_sem +* may be released if it failed to arquire the page_lock. If the
s/arquire/acquire/
Hmm, I thought I fixed that. I better test the first patch again, in case it has issues in it that I thought I fixed.
-- Steve
mm/memory.c unlock: · line 3403
Quoted 12 lines
mm/memory.c +9
-0+* mmap_sem is released then it will return VM_FAULT_RETRY set. +* This is to keep the time mmap_sem is held when the page_lock +* is taken for IO. +* Exception: If FAULT_FLAG_RETRY_NOWAIT is set, then it will +* not release the mmap_sem, but will still return VM_FAULT_RETRY +* if it failed to acquire the page_lock. +* This is for helping virtualization. See get_user_page_nowait(). +* +* Returns status flags based on the VM_FAULT_* flags in <linux/mm.h> */ int handle_mm_fault (struct mm_struct *mm,struct vm_area_struct *vma,unsigned long address,unsigned int flags)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/2] mm: Document handle_mm_fault()
In reply to Steven RostedtQuoted 65 lines · Steven Rostedt
From: Steven Rostedt <[email protected]>
The function
handle_mm_fault()is long overdue for comments. Adding a kernel doc header for the function and explaining the subtle use of the flags with respect tommap_semwill prove useful in the future when others work with this code.Russell King noticed that the code in
arch/x86/mm/fault.clooked buggy as thedo_page_fault()code would grab themmap_semmultiple times without letting it go. But it only did this when thehandle_mm_fault()would returnVM_FAULT_RETRY.Examining the code and reading the git change logs, it was discovered that commit
d065bd810b6deb67d4897a14bfe21f8eb526ba99
mm: retry page fault when blocking on disk transfer
added code to remove contention with themmap_semwhen thepage_lockwas being held for IO. As waiting on IO holding themmap_semcan cause lots of contention between threads. The flagFAULT_FLAG_ALLOW_RETRYwas added to lethandle_mm_fault()know that it can safely release themmap_sem.Adding to the confusion here with
handle_mm_fault(), another
commit318b275fbca1ab9ec0862de71420e0e92c3d1aa7
mm: allow GUP to fail instead of waiting on a page
was added that would not release themmap_sem, even ifFAULT_FLAG_ALLOW_RETRYwas set and thepage_lockwas not taken andVM_FAULT_RETRYwas returned, ifFAULT_FLAGS_RETRY_NOWAITwas set.All of this is poorly documented and makes using or modifying
handle_mm_fault()fragile. Documenting all of these subtle changes at the head ofhandle_mm_fault()should help future developers understand what is happening.Reported-by Russell King <[email protected]>Cc Gleb Natapov <[email protected]>Cc Linus Torvalds <[email protected]>Cc Hugh Dickins <[email protected]>Cc Rik van Riel <[email protected]>Cc Michel Lespinasse <[email protected]>Cc Avi Kivity <[email protected]>Cc Marcelo Tosatti <[email protected]>Cc Andrew Morton <[email protected]>Signed-off-by Steven Rostedt <[email protected]>--- mm/memory.c | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-)mm/memory.c +7
-2@@ -3378,8 +3378,26 @@ unlock:return 0 ; } -/* -* By the time we get here, we already hold the mm semaphore +/** +* handle_mm_fault - main routine for handling page faults +* @mm: the mm_struct of the target address space +* @vma: vm_area_struct holding the applicable pages +* @address: the address that took the fault +* @flags: flags modifying lookup behaviour +*
mm/memory.c unlock: · line 3397
Quoted 10 lines
mm/memory.c +10
-0+* Must have @mm->mmap_sem held. +* +* Note: if @flags has FAULT_FLAG_ALLOW_RETRY set then the mmap_sem +* may be released if it failed to arquire the page_lock. If the +* mmap_sem is released then it will return VM_FAULT_RETRY set. +* This is to keep the time mmap_sem is held when the page_lock +* is taken for IO. +* Exception: If FAULT_FLAG_RETRY_NOWAIT is set, then it will +* not release the mmap_sem, but will still return VM_FAULT_RETRY +* if it failed to acquire the page_lock.
I wouldn't describe it like that. It tells handle_mm_fault() to start IO if needed, but do not wait for its completion.
mm/memory.c unlock: · line 3398
Quoted 1 line
mm/memory.c +1
-0+* This is for helping virtualization. See get_user_page_nowait().
The virtialization is the only user right now, but I wouldn't describe this flag as virtialization specific. Why should we put this in the comment? The comment will become outdated when other users arise and meanwhile a simple grep will reveal the above information anyway.
Quoted 8 lines
mm/memory.c +2
-0+* +* Returns status flags based on the VM_FAULT_* flags in <linux/mm.h> */ int handle_mm_fault (struct mm_struct *mm,struct vm_area_struct *vma,unsigned long address,unsigned int flags)Signature · 1 line
1.7.5.4
--
Gleb.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/2] mm: Document handle_mm_fault()
Quoted 13 lines · Gleb Natapov
Quoted 13 lines
mm/memory.c +11
-2-/* -* By the time we get here, we already hold the mm semaphore +/** +* handle_mm_fault - main routine for handling page faults +* @mm: the mm_struct of the target address space +* @vma: vm_area_struct holding the applicable pages +* @address: the address that took the fault +* @flags: flags modifying lookup behaviour +* +* Must have @mm->mmap_sem held. +* +* Note: if @flags has FAULT_FLAG_ALLOW_RETRY set then the mmap_sem +* may be released if it failed to arquire the page_lock. If the
Quoted 8 lines
Quoted 6 lines
+ * mmap_sem is released then it will return VM_FAULT_RETRY set. + * This is to keep the time mmap_sem is held when the page_lock + * is taken for IO.+ * Exception: If
FAULT_FLAG_RETRY_NOWAITis set, then it will
+ * not release themmap_sem, but will still returnVM_FAULT_RETRY
+ * if it failed to acquire thepage_lock.I wouldn't describe it like that. It tells
handle_mm_fault()to start IO if needed, but do not wait for its completion.
This isn't a description of the flag itself. It's a description of the mmap_sem behavior for the flag. Again, this came about because of the subtle locking that handle_mm_fault() does with mmap_sem. When it comes to locking, we need things documented very well, as locking is usually what most developers get wrong even when subtle locking does not exist.
Quoted 6 lines
Quoted 2 lines
+ * This is for helping virtualization. See
get_user_page_nowait().The virtialization is the only user right now, but I wouldn't describe this flag as virtialization specific. Why should we put this in the comment? The comment will become outdated when other users arise and meanwhile a simple grep will reveal the above information anyway.
I've been going in the direction of adding comments about how things help. OK, so it's the only user now. I could change this to, "This is for helping things like virtualization." When reading code, it is nice to know why something is done that is out of the ordinary.
If it changes, then we should change the comments. The best place for keeping code documented and up to date, is right at the code. ie. comments.
-- Steve
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/2] mm: Document handle_mm_fault()
In reply to Steven RostedtQuoted 5 lines · Steven Rostedt
+ * Note: if @flags has
FAULT_FLAG_ALLOW_RETRYset then themmap_sem
+ * may be released if it failed to arquire thepage_lock. If the
+ *mmap_semis released then it will returnVM_FAULT_RETRYset.
+ * This is to keep the timemmap_semis held when thepage_lock
+ * is taken for IO.
So I know what that flag does, but I knew it without the comment.
WITH the comment, I'm just confused. "This is to keep the time mmap_sem is held when the page_lock is taken for IO."
Sounds like a google translation from swahili. "keep the time" what?
Maybe "keep" -> "minimize"? Or just "This is to avoid holding mmap_sem while waiting for IO"
Linus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/2] mm: Document handle_mm_fault()
Quoted 7 lines · Linus Torvalds
Quoted 5 lines · Steven Rostedt
+ * Note: if @flags has
FAULT_FLAG_ALLOW_RETRYset then themmap_sem+ * may be released if it failed to arquire the page_lock. If the + * mmap_sem is released then it will return VM_FAULT_RETRY set. + * This is to keep the time mmap_sem is held when the page_lock + * is taken for IO.
Quoted 6 lines
So I know what that flag does, but I knew it without the comment.
WITH the comment, I'm just confused. "This is to keep the time
mmap_semis held when thepage_lockis taken for IO."Sounds like a google translation from swahili. "keep the time" what?
"When people ask me what language is my mother tongue, I simply reply C"
Google translate from C -> english is worse than swahily -> english :p
Quoted 3 lines
Maybe "keep" -> "minimize"? Or just "This is to avoid holding
mmap_semwhile waiting for IO"
OK, that sounds better. Thanks.
I'll go to cut a v2, but I'll wait a day or so for others to comment.
-- Steve
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>