From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8E6B42121C109 for ; Fri, 3 May 2019 00:31:31 -0700 (PDT) Date: Fri, 3 May 2019 09:31:26 +0200 From: Oscar Salvador Subject: Re: [PATCH v7 03/12] mm/sparsemem: Add helpers track active portions of a section at boot Message-ID: <20190503073121.GA15740@linux> References: <155677652226.2336373.8700273400832001094.stgit@dwillia2-desk3.amr.corp.intel.com> <155677653785.2336373.11131100812252340469.stgit@dwillia2-desk3.amr.corp.intel.com> <20190502074803.GA3495@linux> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams Cc: Michal Hocko , linux-nvdimm , Linux Kernel Mailing List , Linux MM , Andrew Morton , Vlastimil Babka List-ID: On Thu, May 02, 2019 at 07:03:45AM -0700, Dan Williams wrote: > > section_active_mask() also converts the value to address/size. > > Why do we need to convert the values and we cannot work with pfn/pages instead? > > It should be perfectly possible unless I am missing something. > > > > The only thing required would be to export earlier your: > > > > +#define PAGES_PER_SUB_SECTION (SECTION_ACTIVE_SIZE / PAGE_SIZE) > > +#define PAGE_SUB_SECTION_MASK (~(PAGES_PER_SUB_SECTION-1)) > > > > and change section_active_index to: > > > > static inline int section_active_index(unsigned long pfn) > > { > > return (pfn & ~(PAGE_SECTION_MASK)) / SUB_SECTION_ACTIVE_PAGES; Sorry, here I meant: return (pfn & ~(PAGE_SECTION_MASK)) / PAGES_PER_SUB_SECTION; But I think you got the idea :-) -- Oscar Salvador SUSE L3 _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm