linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: softdirty: keep bit when zapping file pte
@ 2014-09-20  8:03 Peter Feiner
  2014-09-20  8:08 ` Cyrill Gorcunov
  2014-09-24 21:59 ` Andrew Morton
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Feiner @ 2014-09-20  8:03 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-kernel, Cyrill Gorcunov, Pavel Emelyanov, Jamie Liu,
	Hugh Dickins, Andrew Morton, Peter Feiner

Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and
9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of
pte_*mksoft_dirty was being ignored.

To be sure that no other pte/pmd "mk" function return values were
being ignored, I annotated the functions in
arch/x86/include/asm/pgtable.h with __must_check and rebuilt.

Signed-off-by: Peter Feiner <pfeiner@google.com>
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index adeac30..fc46934 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1125,7 +1125,7 @@ again:
 						addr) != page->index) {
 				pte_t ptfile = pgoff_to_pte(page->index);
 				if (pte_soft_dirty(ptent))
-					pte_file_mksoft_dirty(ptfile);
+					ptfile = pte_file_mksoft_dirty(ptfile);
 				set_pte_at(mm, addr, pte, ptfile);
 			}
 			if (PageAnon(page))
-- 
2.1.0.rc2.206.gedb03e5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm: softdirty: keep bit when zapping file pte
  2014-09-20  8:03 [PATCH] mm: softdirty: keep bit when zapping file pte Peter Feiner
@ 2014-09-20  8:08 ` Cyrill Gorcunov
  2014-09-24 21:59 ` Andrew Morton
  1 sibling, 0 replies; 5+ messages in thread
From: Cyrill Gorcunov @ 2014-09-20  8:08 UTC (permalink / raw)
  To: Peter Feiner
  Cc: linux-mm, linux-kernel, Pavel Emelyanov, Jamie Liu, Hugh Dickins,
	Andrew Morton

On Sat, Sep 20, 2014 at 01:03:07AM -0700, Peter Feiner wrote:
> Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and
> 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of
> pte_*mksoft_dirty was being ignored.
> 
> To be sure that no other pte/pmd "mk" function return values were
> being ignored, I annotated the functions in
> arch/x86/include/asm/pgtable.h with __must_check and rebuilt.
> 
> Signed-off-by: Peter Feiner <pfeiner@google.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

I might be missing it, thanks a huge Peter!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm: softdirty: keep bit when zapping file pte
  2014-09-20  8:03 [PATCH] mm: softdirty: keep bit when zapping file pte Peter Feiner
  2014-09-20  8:08 ` Cyrill Gorcunov
@ 2014-09-24 21:59 ` Andrew Morton
  2014-09-24 22:45   ` Peter Feiner
  2014-09-25  6:30   ` Cyrill Gorcunov
  1 sibling, 2 replies; 5+ messages in thread
From: Andrew Morton @ 2014-09-24 21:59 UTC (permalink / raw)
  To: Peter Feiner
  Cc: linux-mm, linux-kernel, Cyrill Gorcunov, Pavel Emelyanov,
	Jamie Liu, Hugh Dickins

On Sat, 20 Sep 2014 01:03:07 -0700 Peter Feiner <pfeiner@google.com> wrote:

> Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and
> 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of
> pte_*mksoft_dirty was being ignored.
> 
> To be sure that no other pte/pmd "mk" function return values were
> being ignored, I annotated the functions in
> arch/x86/include/asm/pgtable.h with __must_check and rebuilt.
> 

Grumble.

It is useful to identify preceding similar patches but that isn't a
good way of describing *this* patch.  What is wrong with the current
code, how does the patch fix it.

And, particularly, what do you think are the end-user visible effects
of the bug?  This info helps people to work out which kernel versions
need the fix.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm: softdirty: keep bit when zapping file pte
  2014-09-24 21:59 ` Andrew Morton
@ 2014-09-24 22:45   ` Peter Feiner
  2014-09-25  6:30   ` Cyrill Gorcunov
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Feiner @ 2014-09-24 22:45 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Cyrill Gorcunov, Pavel Emelyanov, Jamie Liu, linux-mm,
	Hugh Dickins, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 989 bytes --]

On Sep 24, 2014 2:59 PM, "Andrew Morton" <akpm@linux-foundation.org> wrote:
>
> On Sat, 20 Sep 2014 01:03:07 -0700 Peter Feiner <pfeiner@google.com>
wrote:
>
> > Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and
> > 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of
> > pte_*mksoft_dirty was being ignored.
> >
> > To be sure that no other pte/pmd "mk" function return values were
> > being ignored, I annotated the functions in
> > arch/x86/include/asm/pgtable.h with __must_check and rebuilt.
> >
>
> Grumble.
>
> It is useful to identify preceding similar patches but that isn't a
> good way of describing *this* patch.  What is wrong with the current
> code, how does the patch fix it.
>
> And, particularly, what do you think are the end-user visible effects
> of the bug?  This info helps people to work out which kernel versions
> need the fix.
>

Let me think about this and cook up a test case. I'll submit a v2 with a
better description.

Peter

[-- Attachment #2: Type: text/html, Size: 1376 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm: softdirty: keep bit when zapping file pte
  2014-09-24 21:59 ` Andrew Morton
  2014-09-24 22:45   ` Peter Feiner
@ 2014-09-25  6:30   ` Cyrill Gorcunov
  1 sibling, 0 replies; 5+ messages in thread
From: Cyrill Gorcunov @ 2014-09-25  6:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Peter Feiner, linux-mm, linux-kernel, Pavel Emelyanov, Jamie Liu,
	Hugh Dickins

On Wed, Sep 24, 2014 at 02:59:27PM -0700, Andrew Morton wrote:
> On Sat, 20 Sep 2014 01:03:07 -0700 Peter Feiner <pfeiner@google.com> wrote:
> 
> > Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and
> > 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of
> > pte_*mksoft_dirty was being ignored.
> > 
> > To be sure that no other pte/pmd "mk" function return values were
> > being ignored, I annotated the functions in
> > arch/x86/include/asm/pgtable.h with __must_check and rebuilt.
> > 
> 
> Grumble.
> 
> It is useful to identify preceding similar patches but that isn't a
> good way of describing *this* patch.  What is wrong with the current
> code, how does the patch fix it.

The userspace effect is that without this patch softdirty mark might be lost
if file mapped pte get zapped. It should go into @stable series after 3.12.

> 
> And, particularly, what do you think are the end-user visible effects
> of the bug?  This info helps people to work out which kernel versions
> need the fix.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-25  7:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-20  8:03 [PATCH] mm: softdirty: keep bit when zapping file pte Peter Feiner
2014-09-20  8:08 ` Cyrill Gorcunov
2014-09-24 21:59 ` Andrew Morton
2014-09-24 22:45   ` Peter Feiner
2014-09-25  6:30   ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).