Re: [PATCH v2] fix __set_page_dirty_no_writeback() return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 11, 2010 at 11:45 AM, Wu Fengguang <fengguang.wu@xxxxxxxxx> wrote:
> On Thu, Nov 11, 2010 at 11:36:48AM +0800, Bob Liu wrote:
>> On Thu, Nov 11, 2010 at 11:26 AM, Wu Fengguang <fengguang.wu@xxxxxxxxx> wrote:
>> > On Thu, Nov 11, 2010 at 11:05:54AM +0800, 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 v1:
>> >> Â Â Â * preserving cacheline optimisation as Andrew pointed out
>> >>
>> >> Signed-off-by: Bob Liu <lliubbo@xxxxxxxxx>
>> >> ---
>> >> Âmm/page-writeback.c | Â Â4 +++-
>> >> Â1 files changed, 3 insertions(+), 1 deletions(-)
>> >>
>> >> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
>> >> index bf85062..ac7018a 100644
>> >> --- a/mm/page-writeback.c
>> >> +++ b/mm/page-writeback.c
>> >> @@ -1157,8 +1157,10 @@ EXPORT_SYMBOL(write_one_page);
>> >> Â */
>> >> Âint __set_page_dirty_no_writeback(struct page *page)
>> >> Â{
>> >> - Â Â if (!PageDirty(page))
>> >> + Â Â if (!PageDirty(page)) {
>> >> Â Â Â Â Â Â Â SetPageDirty(page);
>> >> + Â Â Â Â Â Â return 1;
>> >> + Â Â }
>> >> Â Â Â return 0;
>> >> Â}
>> >
>> > It's still racy if not using TestSetPageDirty(). In fact
>> > set_page_dirty() has a default reference implementation:
>>
>> Yes, Andrew had also pointed out that. And I have send v3 fix this.
>> Could you ack it?
>
> Acked-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
>

Thanks.

> Thanks!
>
>> >
>> > Â Â Â Âif (!PageDirty(page)) {
>> > Â Â Â Â Â Â Â Âif (!TestSetPageDirty(page))
>> > Â Â Â Â Â Â Â Â Â Â Â Âreturn 1;
>>
>> return !TestSetPageDirty(page) is more simply?
>
> Yeah that's fine.
>
>> > Â Â Â Â}
>> > Â Â Â Âreturn 0;
>> >
>> > It seems the return value currently is only tested for doing
>> > balance_dirty_pages_ratelimited(). So not a big problem.
>> >
>>
>> yeah, all those are small changes no matter with any problem:-).
>
> It's always good to make it correct :) I looked at the users mainly to
> answer the question: is it a must fix for 2.6.37 or even 2.6.36.x?
>

I have no idea, I think either is okay since it's not related with any bug.

-- 
Thanks,
--Bob

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]