WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH V3 1/2] mm: Add SECTION_ALIGN_UP() and SECTION_AL

To: Daniel Kiper <dkiper@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH V3 1/2] mm: Add SECTION_ALIGN_UP() and SECTION_ALIGN_DOWN() macro
From: David Rientjes <rientjes@xxxxxxxxxx>
Date: Wed, 18 May 2011 20:21:23 -0700 (PDT)
Cc: jeremy@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, ian.campbell@xxxxxxxxxx, haicheng.li@xxxxxxxxxxxxxxx, konrad.wilk@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, dan.magenheimer@xxxxxxxxxx, v.tolstov@xxxxxxxxx, Dave Hansen <dave@xxxxxxxxxxxxxxxxxx>, linux-mm@xxxxxxxxx, Andi Kleen <andi.kleen@xxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, fengguang.wu@xxxxxxxxx, wdauchy@xxxxxxxxx
Delivery-date: Wed, 18 May 2011 20:22:29 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1305775296; bh=n+iskZWq/TKWds/8J5/l183rVH0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=s3ZwZ3aPhcrq5JOtTJPvuuBdEbw0qfJ9X+ps7eBYuVKMTsSkcp0wS5Iv9Ht+GD1UA jqpJFBFuvN4EyriB238iA==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:date:from:x-x-sender:to:cc:subject:in-reply-to :message-id:references:user-agent:mime-version:content-type; bh=UrLLd6aCR4XbQgukiTMH+uTojEO5PiIQsaM2R7EHCPw=; b=Jn6XycykuKhJfQMnH4OFI4NMyxlMvNsbtea3mjZkkNmvwAcqvmWSt93Q/xVpvn9mI4 2fKaWBeEJe8dh2jd+CGQ==
Domainkey-signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=tOSlkRsSfc1twmOz1v3xbyI1kMYQXID5ukvv5sPhlluPu/dIgQ+v+5RhPxZtg8qlmM mBnbLzFdqDBgyclbPYdA==
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110517213750.GB30232@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110517213750.GB30232@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Tue, 17 May 2011, Daniel Kiper wrote:

> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index d715200..217bcf6 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -956,6 +956,9 @@ static inline unsigned long early_pfn_to_nid(unsigned 
> long pfn)
>  #define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT)
>  #define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT)
>  
> +#define SECTION_ALIGN_UP(pfn)        (((pfn) + PAGES_PER_SECTION - 1) & 
> PAGE_SECTION_MASK)
> +#define SECTION_ALIGN_DOWN(pfn)      ((pfn) & PAGE_SECTION_MASK)
> +
>  struct page;
>  struct page_cgroup;
>  struct mem_section {

These seem useful.  Could you convert the code in drivers/base/node.c, 
mm/page_cgroup.c, mm/page_alloc.c, and mm/sparse.c that already do this to 
use the new macros?

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>