* [PATCH v3] fix __set_page_dirty_no_writeback() return value
@ 2010-11-11 3:26 Bob Liu
2010-11-11 7:50 ` David Rientjes
0 siblings, 1 reply; 3+ messages in thread
From: Bob Liu @ 2010-11-11 3:26 UTC (permalink / raw)
To: akpm; +Cc: fengguang.wu, linux-mm, kenchen, Bob Liu
__set_page_dirty_no_writeback() should return true if it actually transitioned
the page from a clean to dirty state although it seems nobody used its return
value now.
Change from v2:
* use TestSet to avoid racing
Change from v1:
* preserving cacheline optimisation as Andrew pointed out
Signed-off-by: Bob Liu <lliubbo@gmail.com>
---
mm/page-writeback.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index bf85062..1ebfb86 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1158,7 +1158,7 @@ EXPORT_SYMBOL(write_one_page);
int __set_page_dirty_no_writeback(struct page *page)
{
if (!PageDirty(page))
- SetPageDirty(page);
+ return !TestSetPageDirty(page);
return 0;
}
--
1.6.3.3
--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] fix __set_page_dirty_no_writeback() return value
2010-11-11 3:26 [PATCH v3] fix __set_page_dirty_no_writeback() return value Bob Liu
@ 2010-11-11 7:50 ` David Rientjes
2010-11-11 8:40 ` David Rientjes
0 siblings, 1 reply; 3+ messages in thread
From: David Rientjes @ 2010-11-11 7:50 UTC (permalink / raw)
To: Bob Liu; +Cc: Andrew Morton, Wu Fengguang, linux-mm, Ken Chen
On Thu, 11 Nov 2010, Bob Liu wrote:
> __set_page_dirty_no_writeback() should return true if it actually transitioned
> the page from a clean to dirty state although it seems nobody used its return
> value now.
>
> Change from v2:
> * use TestSet to avoid racing
>
> Change from v1:
> * preserving cacheline optimisation as Andrew pointed out
>
> Signed-off-by: Bob Liu <lliubbo@gmail.com>
> ---
> mm/page-writeback.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index bf85062..1ebfb86 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -1158,7 +1158,7 @@ EXPORT_SYMBOL(write_one_page);
> int __set_page_dirty_no_writeback(struct page *page)
> {
> if (!PageDirty(page))
> - SetPageDirty(page);
> + return !TestSetPageDirty(page);
> return 0;
> }
No need for a conditional, just return !TestSetPageDirty(page).
--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] fix __set_page_dirty_no_writeback() return value
2010-11-11 7:50 ` David Rientjes
@ 2010-11-11 8:40 ` David Rientjes
0 siblings, 0 replies; 3+ messages in thread
From: David Rientjes @ 2010-11-11 8:40 UTC (permalink / raw)
To: Bob Liu; +Cc: Andrew Morton, Wu Fengguang, linux-mm, Ken Chen
On Wed, 10 Nov 2010, David Rientjes wrote:
> > diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> > index bf85062..1ebfb86 100644
> > --- a/mm/page-writeback.c
> > +++ b/mm/page-writeback.c
> > @@ -1158,7 +1158,7 @@ EXPORT_SYMBOL(write_one_page);
> > int __set_page_dirty_no_writeback(struct page *page)
> > {
> > if (!PageDirty(page))
> > - SetPageDirty(page);
> > + return !TestSetPageDirty(page);
> > return 0;
> > }
>
> No need for a conditional, just return !TestSetPageDirty(page).
>
Oops, just read Andrew's reply to v1 of the patch about the cacheline
invalidation of bts, sorry for the noise.
--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-11 8:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-11 3:26 [PATCH v3] fix __set_page_dirty_no_writeback() return value Bob Liu
2010-11-11 7:50 ` David Rientjes
2010-11-11 8:40 ` David Rientjes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox