>From akpm@linux-foundation.org Wed May 4 01:36:10 2011 Received: from smtp1.linux-foundation.org ([140.211.169.13]:60363 "EHLO smtp1.linux-foundation.org" TLS-CIPHER: "EDH-RSA-DES-CBC3-SHA keybits 168/168 version TLSv1/SSLv3") by router-fw-old.local.net-space.pl with ESMTP id S1543901Ab1ECXgK (ORCPT ); Wed, 4 May 2011 01:36:10 +0200 Received-SPF: pass (router-fw.net-space.pl: domain of linux-foundation.org designates 140.211.169.13 as permitted sender) client-ip=140.211.169.13; envelope-from=akpm@linux-foundation.org; helo=smtp1.linux-foundation.org; Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p43NZt8T007131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 May 2011 16:35:55 -0700 Received: from localhost.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id p43NZsk4017523; Tue, 3 May 2011 16:35:54 -0700 Message-Id: <201105032335.p43NZsk4017523@imap1.linux-foundation.org> Subject: + mm-enable-set_page_section-only-if-config_sparsemem-and-config_sparsemem_vmemmap.patch added to -mm tree To: mm-commits@vger.kernel.org Cc: dkiper@net-space.pl, dave@linux.vnet.ibm.com From: akpm@linux-foundation.org Date: Tue, 03 May 2011 16:35:54 -0700 X-Spam-Status: No, hits=-102.983 required=5 tests=AWL,BAYES_00,USER_IN_WHITELIST X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Bogosity: No, spamicity=0.433210 Return-Path: X-Envelope-To: <"|/usr/bin/procmail -m /home/dkiper/.procmailrc"> (uid 4000) X-Orcpt: rfc822;dkiper@net-space.pl Original-Recipient: rfc822;dkiper@net-space.pl Status: RO Content-Length: 3134 Lines: 82 The patch titled mm: enable set_page_section() only if CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP has been added to the -mm tree. Its filename is mm-enable-set_page_section-only-if-config_sparsemem-and-config_sparsemem_vmemmap.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: mm: enable set_page_section() only if CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP From: Daniel Kiper set_page_section() is valid only in CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP context. Move it to proper place and amend accordingly functions which are using it. Signed-off-by: Daniel Kiper Acked-by: Dave Hansen Signed-off-by: Andrew Morton --- include/linux/mm.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff -puN include/linux/mm.h~mm-enable-set_page_section-only-if-config_sparsemem-and-config_sparsemem_vmemmap include/linux/mm.h --- a/include/linux/mm.h~mm-enable-set_page_section-only-if-config_sparsemem-and-config_sparsemem_vmemmap +++ a/include/linux/mm.h @@ -682,6 +682,12 @@ static inline struct zone *page_zone(str } #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) +static inline void set_page_section(struct page *page, unsigned long section) +{ + page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); + page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; +} + static inline unsigned long page_to_section(struct page *page) { return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; @@ -700,18 +706,14 @@ static inline void set_page_node(struct page->flags |= (node & NODES_MASK) << NODES_PGSHIFT; } -static inline void set_page_section(struct page *page, unsigned long section) -{ - page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); - page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; -} - static inline void set_page_links(struct page *page, enum zone_type zone, unsigned long node, unsigned long pfn) { set_page_zone(page, zone); set_page_node(page, node); +#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) set_page_section(page, pfn_to_section_nr(pfn)); +#endif } /* _ Patches currently in -mm which might be from dkiper@net-space.pl are linux-next.patch mm-remove-dependency-on-config_flatmem-from-online_page.patch mm-enable-set_page_section-only-if-config_sparsemem-and-config_sparsemem_vmemmap.patch mm-pfn_to_section_nr-section_nr_to_pfn-is-valid-only-in-config_sparsemem-context.patch mm-do-not-define-pfn_section_shift-if-config_sparsemem.patch