public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Rob Landley <rob@landley.net>
Cc: Christoph Lameter <clameter@sgi.com>,
	Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	Mike Kravetz <kravetz@us.ibm.com>,
	Ray Bryant <raybry@mpdtxmail.amd.com>,
	Lee Schermerhorn <lee.schermerhorn@hp.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Magnus Damm <magnus.damm@gmail.com>, Paul Jackson <pj@sgi.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: [PATCH 3/5] Swap Migration V5: migrate_pages() function
Date: Tue, 01 Nov 2005 09:59:35 +0100	[thread overview]
Message-ID: <1130835575.14475.40.camel@localhost> (raw)
In-Reply-To: <200511010206.24800.rob@landley.net>

On Tue, 2005-11-01 at 02:06 -0600, Rob Landley wrote:
> On Monday 31 October 2005 21:12, Christoph Lameter wrote:
> > Page migration support in vmscan.c
> 
> This has no #ifdef SWAP:
> 
> > + if (PageSwapCache(page)) {
> > +  swp_entry_t swap = { .val = page_private(page) };
> > +  add_to_swapped_list(swap.val);
> > +  __delete_from_swap_cache(page);
> > +  write_unlock_irq(&mapping->tree_lock);
> > +  swap_free(swap);
> > +  __put_page(page); /* The pagecache ref */
> > +  return 1;
> > + }
> 
> But what you removed did:
> 
> > -#ifdef CONFIG_SWAP
> > -  if (PageSwapCache(page)) {
> > -   swp_entry_t swap = { .val = page_private(page) };
> > -   add_to_swapped_list(swap.val);
> > -   __delete_from_swap_cache(page);
> > -   write_unlock_irq(&mapping->tree_lock);
> > -   swap_free(swap);
> > -   __put_page(page); /* The pagecache ref */
> > -   goto free_it;
> > -  }
> > -#endif /* CONFIG_SWAP */
> 
> What happens if you build without swap?

You don't need an explicit #ifdef.

PageSwapCache() has an #ifdef for its declaration which gets it down to
'0'.  That should get gcc to completely kill the if(){} block, with no
explicit #ifdef.  

-- Dave


  reply	other threads:[~2005-11-01  8:59 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-01  3:12 [PATCH 0/5] Swap Migration V5: Overview Christoph Lameter
2005-11-01  3:12 ` [PATCH 1/5] Swap Migration V5: LRU operations Christoph Lameter
2005-11-07  7:35   ` Magnus Damm
2005-11-07 17:41     ` Christoph Lameter
2005-11-07 18:12       ` Christoph Lameter
2005-11-15  5:44   ` Andrew Morton
2005-11-15 16:38     ` Christoph Lameter
2005-11-15 16:43       ` SKB tutorial, Blog, and NET TODO Surya Satyavolu
2005-11-15 18:02       ` [PATCH 1/5] Swap Migration V5: LRU operations Andrew Morton
2005-11-15 18:22         ` Christoph Lameter
2005-11-15 18:46           ` Andrew Morton
2005-12-31  7:32             ` Marcelo Tosatti
2005-11-15 18:08       ` Lee Schermerhorn
2005-11-01  3:12 ` [PATCH 2/5] Swap Migration V5: PF_SWAPWRITE to allow writing to swap Christoph Lameter
2005-11-01  3:12 ` [PATCH 3/5] Swap Migration V5: migrate_pages() function Christoph Lameter
2005-11-01  8:06   ` Rob Landley
2005-11-01  8:59     ` Dave Hansen [this message]
2005-11-01  3:12 ` [PATCH 4/5] Swap Migration V5: MPOL_MF_MOVE interface Christoph Lameter
2005-11-01  3:13 ` [PATCH 5/5] Swap Migration V5: sys_migrate_pages interface Christoph Lameter
2005-11-01  5:27   ` Andrew Morton
2005-11-01 12:00     ` linux-os (Dick Johnson)
2005-11-01 18:10       ` Christoph Lameter
2005-11-01 17:39     ` Christoph Lameter
2005-11-01  3:25 ` [PATCH 0/5] Swap Migration V5: Overview Andrew Morton
2005-11-01  8:08   ` Rob Landley
2005-11-01 17:44     ` Christoph Lameter
2005-11-02  5:30       ` Hirokazu Takahashi
2005-11-02  8:31         ` Christoph Lameter
2005-11-02  8:45           ` Hirokazu Takahashi
2005-11-02 12:26           ` Hirokazu Takahashi
2005-11-02 13:08             ` Hirokazu Takahashi
2005-11-02 14:11             ` Kamezawa Hiroyuki
2005-11-02 15:48             ` Christoph Lameter
2005-11-02 20:00     ` Christoph Lameter
2005-11-01 10:22   ` KAMEZAWA Hiroyuki
2005-11-01 17:19   ` Christoph Lameter

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=1130835575.14475.40.camel@localhost \
    --to=haveblue@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kravetz@us.ibm.com \
    --cc=lee.schermerhorn@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=pj@sgi.com \
    --cc=raybry@mpdtxmail.amd.com \
    --cc=rob@landley.net \
    --cc=torvalds@osdl.org \
    /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