linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>,
	Pavel Emelyanov <xemul@parallels.com>
Cc: Linux MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Matt Mackall <mpm@selenic.com>,
	Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] mm: Save soft-dirty bits on file pages
Date: Mon, 29 Jul 2013 20:28:54 +0530	[thread overview]
Message-ID: <878v0ps98x.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130729141417.GM2524@moon>

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

--
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>

  parent reply	other threads:[~2013-07-29 14:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 20:18 [PATCH] mm: Save soft-dirty bits on file pages Cyrill Gorcunov
2013-07-26 20:55 ` Andy Lutomirski
2013-07-26 21:18   ` Cyrill Gorcunov
2013-07-26 21:36     ` Andy Lutomirski
2013-07-27  6:25       ` Cyrill Gorcunov
2013-07-27 17:06         ` Andy Lutomirski
2013-07-27 21:01           ` Cyrill Gorcunov
2013-07-27 19:29   ` Pavel Emelyanov
2013-07-28  9:28     ` Pavel Emelyanov
2013-07-29 14:08 ` Pavel Emelyanov
2013-07-29 14:14   ` Cyrill Gorcunov
2013-07-29 14:24     ` Pavel Emelyanov
2013-07-29 14:36       ` Cyrill Gorcunov
2013-07-29 14:58     ` Aneesh Kumar K.V [this message]
2013-07-29 15:02       ` Cyrill Gorcunov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878v0ps98x.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=gorcunov@gmail.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@amacapital.net \
    --cc=mpm@selenic.com \
    --cc=mtosatti@redhat.com \
    --cc=sfr@canb.auug.org.au \
    --cc=xemul@parallels.com \
    --cc=xiaoguangrong@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).