lkml.org 
[lkml]   [2013]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] mm: Save soft-dirty bits on file pages
Date
Cyrill Gorcunov <gorcunov@gmail.com> writes:

> On Mon, Jul 29, 2013 at 06:08:55PM +0400, Pavel Emelyanov wrote:
>> >
>> > - if (!pte_none(*pte))
>> > + ptfile = pgoff_to_pte(pgoff);
>> > +
>> > + if (!pte_none(*pte)) {
>> > +#ifdef CONFIG_MEM_SOFT_DIRTY
>> > + if (pte_present(*pte) &&
>> > + pte_soft_dirty(*pte))
>>
>> I think there's no need in wrapping every such if () inside #ifdef CONFIG_...,
>> since the pte_soft_dirty() routine itself would be 0 for non-soft-dirty case
>> and compiler would optimize this code out.
>
> If only I'm not missing something obvious, this code compiles not only on x86,
> CONFIG_MEM_SOFT_DIRTY depends on x86 (otherwise I'll have to implement
> pte_soft_dirty for all archs).

why not

#ifndef pte_soft_dirty
#define pte_soft_dirty(pte) 0
#endif

and on x86
#define pte_soft_dirty pte_soft_dirty

-aneesh



\
 
 \ /
  Last update: 2013-07-29 17:21    [W:0.086 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site