Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756660AbdGXViC (ORCPT ); Mon, 24 Jul 2017 17:38:02 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:53294 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756606AbdGXVha (ORCPT ); Mon, 24 Jul 2017 17:37:30 -0400 Date: Mon, 24 Jul 2017 17:37:13 -0400 From: Dennis Zhou To: Tejun Heo CC: Christoph Lameter , , , , Dennis Zhou Subject: Re: [PATCH 09/10] percpu: replace area map allocator with bitmap allocator Message-ID: <20170724213712.GE91613@dennisz-mbp.dhcp.thefacebook.com> References: <20170716022315.19892-1-dennisz@fb.com> <20170716022315.19892-10-dennisz@fb.com> <20170717232756.GC585283@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170717232756.GC585283@devbig577.frc2.facebook.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [2620:10d:c091:200::2:3425] X-ClientProxiedBy: CY4PR16CA0024.namprd16.prod.outlook.com (10.172.173.34) To BY2PR15MB0503.namprd15.prod.outlook.com (10.163.110.152) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15a411ca-b410-436d-e331-08d4d2dc2ad4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BY2PR15MB0503; X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0503;3:dzPZbF9tbW3EPButUL7bxXnQCQG1NkQUS9myxPYSPFUUFejbuPSO3YaO4riL1b5kFiD4Yxuxi0slFrb/+VPs3TRBaipEG6poLvBwqXtL4cChX0Win4nYjzoG9Sb96b7hUMWbniNcPRQ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ACKxcB43sTMEpzAAif9R7lmV/KKyMtnyTcuRqDcgkMrkYqhyUTZVFDtjir43lpgdUzi2ATiV5a/QuwMYYDCwE/c8eSeerra2X1AAhJT/qSzt/qkgsObOUJKKLf/9vi4mh/wG/pUwerjn3vi761jKfn7mYy+hPC4HauXjoOMMdhdRqq1FjXx2JbMMss7+mlWtV6rArNbayuKU3A= X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0503;20:A1Rl6yKG6qVnix8ycyngt9r0X2o76bXxt7LMvQqaGIxXiGyFItHM3D8membgcMqfgoopsHeEQmYRt4BudU1zfJOPdFWe5gY9t0r6CV9qwVWYz/Sx8O/3egBbW0tTlxaF1Hq97RK89KH/BsZSHH6kVob2CRe73ZDHUSlMaYztyc50quvk2OHaOQiioxSzHrMNHI5CYoySXIFEJwPDC/E4jCGhkVDScPXZIsYtyKASbPfKjVVWoVhdyjOh6Q5g+AYbYVqDj3azx2KJj0rMHCOQJRiHNsSWxF24HWpVbmaP6QJMMPhG7chUPTEtBHYux4D676z+6w7hHLscDiyrcHfHopclpgqKxwXPANXkFjEZA/8vOj3rVOi2HNNvXJQ+DAPphknzbxCuGkKFb37I001miMoiO+10cg9E1/IBy0aAmYhE103diDQI05mrTkNL5s8VHFinlGJXoMA5JLu39627yk8yGpOru32OCo1lIKjbWao44d0svf09P/ZaZGenONjY X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(17755550239193); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6041248)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY2PR15MB0503;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY2PR15MB0503; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR15MB0503;4:ip/adpR2MNJmG56hEF1X1frXzhQ7SC6LkEHdDiUjuT?= =?us-ascii?Q?t1MfMLts8gTeR95QIoB9P/FdToAU31lybDXJxzP4KhnF2fCm1EYO/7sf4oIs?= =?us-ascii?Q?i7s15Da9hirPhBfRVnoNOQUy8oZIKc552NchlPEgdA84Yzp1FFJnvZ7143tO?= =?us-ascii?Q?GIPNEi/3wIEevQVO7nmC/K2xM9KyaTgtneVMZm2Qilj9gJgu8sJvshctV8Ma?= =?us-ascii?Q?4WXMcx+OARknMrjABfPcRqhs4Ltckm7sfu9rqs3lDx+A5hNVNDhM46mWsJpz?= =?us-ascii?Q?o0bz+EjS6r0Bmk+loNPISMbewB1GSUhxFzIfZ/noQKBT2sUiuSGqT1Lefw6u?= =?us-ascii?Q?nUqzcL9Bx1Y2uTiWHBK31yz+7tzvyvQ7avcqBNCJf9/Xu8LygeLiUjZtkmXb?= =?us-ascii?Q?/mJBkIq2NSf5TzdMC0TQLpE5gJ4gSHvC67TBanQoft/z8rFSQppNlj9aFx2V?= =?us-ascii?Q?s+CP2xAwkZVp979pwAEJPsEF/ipg9l4hOwuf1VmZ6FiFE8dpMPCDQdCmwX2n?= =?us-ascii?Q?AEFrQ/Ea5GsBx0ru2OyKu70jhdVi2UfOZzo0xpqjMAr7KHaR+16ZOWIngkLk?= =?us-ascii?Q?Y3+UlkyWI/IEqBvRNOoz2CQjUgbcLALBY5nbX4NyAT812nHegzTkzTk93gAJ?= =?us-ascii?Q?Y3Bh//izl29KhLfQJeZlafo5UjUIbrPA13VZuUq/UXnQOGiSsIexqXdon9D8?= =?us-ascii?Q?/i5grmZAG26ojhw1DT20Ttxf1aCfGqJoUaBYXgc2ryxq5WXbHK/NUIVICf82?= =?us-ascii?Q?Zs2AD6Vx1ngkn5rgNHhDjUQtFOsC/D7fEO2I+2sQyjbDY9Xxh/rvs9KnEcA6?= =?us-ascii?Q?kRYCrcieF2+3IHHXKhKTCog74sBibdns/R1ZN4/+TVC2EOR7rtzox5cZ+jmA?= =?us-ascii?Q?UF1+JvVBcGfae581vp/rMYsIenIo4Li0sj5bb1Dayy1ip+wnUFwI8M50Q0km?= =?us-ascii?Q?l0xukzDPL/5C7aYXZntpTC2QetJWwLHkAPSlfNdSWTmfwU0roQ1rf124mtnA?= =?us-ascii?Q?w428DkcQXVjUnJnXBd8wezkaPcL9fzK5KsKtCJ06HhZfwgYUzQODFjP7Cmv7?= =?us-ascii?Q?52pdGjkEAzR2EIdPLmM6pvLeDfZm2HMWzK/7VfZnBRTvvwoU2EMU5AsgmpTR?= =?us-ascii?Q?7/lTlirQUu2Y6EdA+ykS3Wdks8Cuw+V57NC2RTENSplHON11iJVD34DCKnqd?= =?us-ascii?Q?gWv5IjB8cn/ML2rp026evUbXGTbkf9T93ZEOdvLiN81ra05y1gvNPKXw=3D?= =?us-ascii?Q?=3D?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6009001)(39840400002)(39400400002)(39410400002)(39850400002)(39450400003)(199003)(24454002)(57704003)(189002)(229853002)(6506006)(42186005)(2950100002)(6246003)(53936002)(6666003)(8676002)(81166006)(54906002)(50986999)(54356999)(76176999)(110136004)(38730400002)(50466002)(68736007)(81156014)(9686003)(6916009)(4001350100001)(305945005)(83506001)(2906002)(7736002)(101416001)(478600001)(47776003)(86362001)(189998001)(25786009)(55016002)(1076002)(6116002)(5660300001)(33656002)(105586002)(106356001)(97736004)(4326008)(23726003)(7350300001)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0503;H:dennisz-mbp.dhcp.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?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L1tXUYHNRTiPls2AO1D1g?= =?us-ascii?Q?7NNLMys1y4VqQX2PQ3F2fevZJOd5WFEc82gSLHgL7ItUtyBcL3cY0p/2jINx?= =?us-ascii?Q?l9aRm4bx8qVBPrKTla0W01mbbcpiVwsgL+1VQTz/gDKmhx7yVH26aVcNX32l?= =?us-ascii?Q?JULuRkQa9dh6admyziFCwZFXU+NHiYHkAGRwc9l99r4Zx3yLJBGFUVpYKGHe?= =?us-ascii?Q?75EYMS88XujZB5YHq9qlLJc2bTSHO9kVIYMmTRhlw7fi8ZTwFETM0mUIMln0?= =?us-ascii?Q?3PFSnJRGd//FC5JXvTEDN8xVeUzRuZy/irFqFrbjcfTQ5oZBFY1tId8evQnD?= =?us-ascii?Q?lthUERa8xBbDgsJnyrkOGpQaQH/+SDK5eoRShL4qqqNnnbGIMsQHk/R48JxO?= =?us-ascii?Q?jc4OO1BhTGu78UHx2gp2QDXXAPdMsqwCQalcCqVLSeOb6C1fe5es6D132PF9?= =?us-ascii?Q?Dhxh9oSWzfhxwMbHk0WP7Z8QbwJOb4TDDShQN0dF0TJx8E7h24QlPAp8wAXY?= =?us-ascii?Q?VM2vA=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR15MB0503;6:6vkLOQvHMZ2i9glIF4DU7oA8wVlv6OzPhbL0Nkzu5W?= =?us-ascii?Q?70mKJLawDdcCtLUHsBPT0296l29XgLr9uuLw98MmSd1YAheqKD2UQT53sx+s?= =?us-ascii?Q?MXJFphZtF6ZlQXhj/IVTFkrE725K+3AXLpEJsWNFnrkRY6tmRlRmH9m67ziR?= =?us-ascii?Q?sYunrAuzKVW5ynaa7KVVHzmq3U70FoFYHfXuPcNtd1ecRg3GeSLa65wGtgVs?= =?us-ascii?Q?8NHUoP05H+YIeSSTh6exPVkvI2Cc5Q2ctyOAQxrTYx4fPBFPtTnaarmxRp9T?= =?us-ascii?Q?rafNL/+m/LQcwn4fFLd/0/77BIVD9Hb55mxuPH7XKFa0gYOzcQWOU+/SILgi?= =?us-ascii?Q?z6HMFz3CY5Wb/hKSr6BOaDXc0G/P1MV0Z0DIJfUbTREN7NPH1oMJLZjVurng?= =?us-ascii?Q?OOEztr56OixNU4mKXAZIqMi504MbyWoGvcUAcU2I0rEliS8ITz3sDRcDtRfk?= =?us-ascii?Q?5eWw3k3ZweRca8OWCL7m4lAGxuK6mWa7iqg0XXzeYKVRNrKdqVE8TS34NuJP?= =?us-ascii?Q?+n2Ke0N+u568tipJSKiJzx7EAQi7XdTmRbLM75N2n4YomIkEBtfFubR24C8p?= =?us-ascii?Q?CKyDoGNHWtjdGb46AgNyxO0Mj2hhOrviFS5XxDwzMxswV9JZtSY6afJt4cHW?= =?us-ascii?Q?ti4oD96yNnKKc6p7gwvnrQY/mZCEca6mBEv5n6YVwq8FgulY3jDb+HzWHIu3?= =?us-ascii?Q?/L+rTBGtsPjT892L5oXHv0fJodR8t52swmlbG0V7wzeudoAe/LPun4nmklHA?= =?us-ascii?Q?wpaJX+DnYOCPqxmkTUV40QJzOTpcri6dzG/71bJnG/v071vt3998exshVbnb?= =?us-ascii?Q?7J6m/Zn4F9mH3cmHhVfEzjK9uHNoaqeOTi75K74/ttNjXPPhJn9FaCWe3sVS?= =?us-ascii?Q?gjRP0+AZMpKKH5LBRNBjtPnj2Bop1ciOe/rVTMvFW3Ysi6vYYig+ekTLtsUp?= =?us-ascii?Q?bYeJ+QCOiG8o0OzMatYLiQU4JpCfovHP5flS3g1fQlTCtXZcn40Hru02vC4y?= =?us-ascii?Q?I=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0503;5:EaSmyqNibtwc/8nwYhZK0ZxFOlf2/gMwlBO56oMexoodR+sjR2C61Yr8d7HD3nsUjUmKv2d8HSXK9GQJ27xr6GSGXuCuXddprbl1nj2XT5Ov01zI22SUpPo0BiAThGZngBWvNOwKpFz/BhBXbRxqstLipu5UO8UGU9TZI7hZ7kmhijDCKFp4H6cF3Cgo30YiXLck/5zIauRNumH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rpLD14/VG5+FbkCfWYJK3qeAAXf30pJ2rqqCEzEQI8bqv56vlkYp6g2Oc0Gb8HiL3747ovZdAfVTiUppcsdZMHGqrsmI8+O/P4IZS7vdTjnj+341NowsV475aj6kSHJfBVEOQoJwKYEPzYENT+jL1nZhew/A4mXsfhdyvB+vcqrnClDP2WaMSwg7K3Awl+MqzLJc/StFHzVuu7Wv7Cf62zmkN/HOcFUiniQp8I= X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0503;20:3U8koU3N1JIOhOtXI+kRufPnOk5GVpTd1tRKG84H99Isoz+CxJ9ykfUgLTw/9WsUHu9+LlIFocGyurh6mnx4NsawzhcQ2x3YcYUKYaSVWRYaDaMEa4sD5moYm3oSAPEGJd1pp5Nm414AVRG5VHHsVWdsiI1grBSqaXTWBnOuY9A= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 21:37:21.0518 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0503 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-24_13:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 14698 Lines: 439 On Mon, Jul 17, 2017 at 07:27:56PM -0400, Tejun Heo wrote: > I think it'd be nice to have a similar table for allocation patterns > which aren't ideal for the original allocator. The biggest goal is > avoiding cases where the allocator collapses and just glancing at the > table doesn't seem very compelling. I've added new data to the cover letter and in the commit log to demonstrate poor allocation performance. > > /* > > + * This determines the size of each metadata block. There are several subtle > > + * constraints around this variable. The reserved_region and dynamic_region > ^ > constant > Fixed. > > + * of the first chunk must be multiples of PCPU_BITMAP_BLOCK_SIZE. This is > > + * not a problem if the BLOCK_SIZE encompasses a page, but if exploring blocks > > + * that are backing multiple pages, this needs to be accounted for. > > + */ > > +#define PCPU_BITMAP_BLOCK_SIZE (PAGE_SIZE >> PCPU_MIN_ALLOC_SHIFT) > > Given that percpu allocator can align only upto a page, the > restriction makes sense to me. I'm kinda curious whether PAGE_SIZE > blocks is optimal tho. Why did you pick PAGE_SIZE? > I've refactored v2 to be able to handle block sizes with certain constraints. The PAGE_SIZE blocks really just were a balance between amount required to scan and the number of metadata blocks. I tested 2KB blocks and they seemed to perform marginally worse. > > +/* > ^^ > /** > > Ditto for other comments. > Fixed. > > + * pcpu_nr_pages_to_blocks - converts nr_pages to # of md_blocks > > + * @chunk: chunk of interest > > + * > > + * This conversion is from the number of physical pages that the chunk > > + * serves to the number of bitmap blocks required. It converts to bytes > > + * served to bits required and then blocks used. > > + */ > > +static inline int pcpu_nr_pages_to_blocks(struct pcpu_chunk *chunk) > > Maybe just pcpu_chunk_nr_blocks()? > Renamed. > > +{ > > + return chunk->nr_pages * PAGE_SIZE / PCPU_MIN_ALLOC_SIZE / > > + PCPU_BITMAP_BLOCK_SIZE; > > +} > > + > > +/* > > + * pcpu_pages_to_bits - converts the pages to size of bitmap > > + * @pages: number of physical pages > > + * > > + * This conversion is from physical pages to the number of bits > > + * required in the bitmap. > > + */ > > +static inline int pcpu_pages_to_bits(int pages) > > pcpu_nr_pages_to_map_bits()? > Renamed. > > +{ > > + return pages * PAGE_SIZE / PCPU_MIN_ALLOC_SIZE; > > +} > > + > > +/* > > + * pcpu_nr_pages_to_bits - helper to convert nr_pages to size of bitmap > > + * @chunk: chunk of interest > > + * > > + * This conversion is from the number of physical pages that the chunk > > + * serves to the number of bits in the bitmap. > > + */ > > +static inline int pcpu_nr_pages_to_bits(struct pcpu_chunk *chunk) > > pcpu_chunk_map_bits()? > Renamed. > > @@ -86,10 +90,13 @@ > > > > #include "percpu-internal.h" > > > > -#define PCPU_SLOT_BASE_SHIFT 5 /* 1-31 shares the same slot */ > > -#define PCPU_DFL_MAP_ALLOC 16 /* start a map with 16 ents */ > > -#define PCPU_ATOMIC_MAP_MARGIN_LOW 32 > > -#define PCPU_ATOMIC_MAP_MARGIN_HIGH 64 > > +/* > > + * The metadata is managed in terms of bits with each bit mapping to > > + * a fragment of size PCPU_MIN_ALLOC_SIZE. Thus, the slots are calculated > > + * with respect to the number of bits available. > > + */ > > +#define PCPU_SLOT_BASE_SHIFT 3 > > Ah, so this is actually the same as before 3 + 2, order 5. Can you > please note the explicit number in the comment? > With the refactor in v2, the slots are back to being managed in bytes. > > #define PCPU_EMPTY_POP_PAGES_LOW 2 > > #define PCPU_EMPTY_POP_PAGES_HIGH 4 > > and these numbers too. I can't tell how these numbers would map. > Also, any chance we can have these numbers in a more intuitive unit? > Those are from the original implementation to decide when to schedule work to repopulate the empty free page pool. > > @@ -212,25 +220,25 @@ static bool pcpu_addr_in_reserved_chunk(void *addr) > > pcpu_reserved_chunk->nr_pages * PAGE_SIZE; > > } > > > > -static int __pcpu_size_to_slot(int size) > > +static int __pcpu_size_to_slot(int bit_size) > > Wouldn't sth like @map_bits more intuitive than @bit_size? We can > just use @bits too. > Back to bytes. > > { > > - int highbit = fls(size); /* size is in bytes */ > > + int highbit = fls(bit_size); /* size is in bits */ > > return max(highbit - PCPU_SLOT_BASE_SHIFT + 2, 1); > > } > > > > -static int pcpu_size_to_slot(int size) > > +static int pcpu_size_to_slot(int bit_size) > > Ditto. > Back to bytes. > > +static void pcpu_chunk_update_hint(struct pcpu_chunk *chunk) > > It's a span iteration problem. When abstracted properly, it shouldn't > be too difficult to follow. > I agree, I've refactored to use an iterator. > > +static void pcpu_block_refresh_hint(struct pcpu_chunk *chunk, int index) > It's a lot simpler here but this too might look simpler with an > appropriate interation abstraction. Generalized the populated bitmap iterators so it can be used here. > > Hmm... why do we need is_left/right_free? Can't we reset them to zero > at the top and update directly during the loop? > Yes. Done. > > @update_chunk seems unnecessary. > I've moved the chunk refresh call to be here. > > So, if you do the above with inclusive range, it becomes > > s_index = pcpu_off_to_block_index(start_bit); > e_index = pcpu_off_to_block_index(end_bit - 1); > s_off = pcpu_off_to_block_off(start_bit); > e_off = pcpu_off_to_block_off(end_bit - 1) + 1; > > and you can just comment that you're using inclusive range so that the > e_index always points to the last block in the range. Wouldn't that > be easier? People do use inclusive ranges for these sorts of > calculations. Ah I see, thanks. Done. > > How about something like the following? It's kinda weird to have an > extra loop var which isn't really used for anything. The same goes > for other places too. > > for (block = chunk->md_blocks + s_index + 1; > block < chunk->md_blocks + e_index; block++) > I've rewritten most for loops to do this. > > + block->first_free = 0; > > +static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int bit_size, > > + size_t align, bool pop_only) > > Wouldn't this function be a lot simpler too if there were free span > iterator? > Yes added an iterator for this. > > + > > + /* update alloc map */ > > + bitmap_set(chunk->alloc_map, bit_off, bit_size); > > blank line > Added. > > Do we ever not update chunk hint when block hint indicates that it's > necessary? If not, maybe just call it from the previous function? > No. I've added the call to the previous function. > > @@ -787,6 +1179,7 @@ static void pcpu_chunk_populated(struct pcpu_chunk *chunk, > > > > bitmap_set(chunk->populated, page_start, nr); > > chunk->nr_populated += nr; > > + chunk->nr_empty_pop_pages += nr; > > pcpu_nr_empty_pop_pages += nr; > > } > > > > @@ -809,6 +1202,7 @@ static void pcpu_chunk_depopulated(struct pcpu_chunk *chunk, > > > > bitmap_clear(chunk->populated, page_start, nr); > > chunk->nr_populated -= nr; > > + chunk->nr_empty_pop_pages -= nr; > > pcpu_nr_empty_pop_pages -= nr; > > } > > Didn't we add this field in an earlier patch? Do the above changes > belong in this patch? > Yes, moved to previous patch. > > + size_t bit_size, bit_align; > > > > /* > > + * There is now a minimum allocation size of PCPU_MIN_ALLOC_SIZE. > > + * Therefore alignment must be a minimum of that many bytes as well > > + * as the allocation will have internal fragmentation from > > + * rounding up by up to PCPU_MIN_ALLOC_SIZE - 1 bytes. > > */ > > + if (unlikely(align < PCPU_MIN_ALLOC_SIZE)) > > + align = PCPU_MIN_ALLOC_SIZE; > > + size = ALIGN(size, PCPU_MIN_ALLOC_SIZE); > > + bit_size = size >> PCPU_MIN_ALLOC_SHIFT; > > + bit_align = align >> PCPU_MIN_ALLOC_SHIFT; > > Shouldn't the above have happened earlier when MIN_ALLOC_SIZE was > introduced? > Yes, moved to previous patch. > > @@ -1363,15 +1710,15 @@ bool is_kernel_percpu_address(unsigned long addr) > > * address. The caller is responsible for ensuring @addr stays valid > > * until this function finishes. > > * > > - * percpu allocator has special setup for the first chunk, which currently > > + * Percpu allocator has special setup for the first chunk, which currently > > * supports either embedding in linear address space or vmalloc mapping, > > * and, from the second one, the backing allocator (currently either vm or > > * km) provides translation. > > * > > * The addr can be translated simply without checking if it falls into the > > - * first chunk. But the current code reflects better how percpu allocator > > + * first chunk. But the current code reflects better how percpu allocator > > * actually works, and the verification can discover both bugs in percpu > > - * allocator itself and per_cpu_ptr_to_phys() callers. So we keep current > > + * allocator itself and per_cpu_ptr_to_phys() callers. So we keep current > > Let's please move out what can be to other patches. This patch is big > enough as it is. > Removed. > > @@ -1417,9 +1764,10 @@ phys_addr_t per_cpu_ptr_to_phys(void *addr) > > else > > return page_to_phys(vmalloc_to_page(addr)) + > > offset_in_page(addr); > > - } else > > + } else { > > return page_to_phys(pcpu_addr_to_page(addr)) + > > offset_in_page(addr); > > + } > > Ditto. > Removed. > > @@ -1555,10 +1903,12 @@ static void pcpu_dump_alloc_info(const char *lvl, > > * static areas on architectures where the addressing model has > > * limited offset range for symbol relocations to guarantee module > > * percpu symbols fall inside the relocatable range. > > + * @ai->static_size + @ai->reserved_size is expected to be page aligned. > > * > > * @ai->dyn_size determines the number of bytes available for dynamic > > - * allocation in the first chunk. The area between @ai->static_size + > > - * @ai->reserved_size + @ai->dyn_size and @ai->unit_size is unused. > > + * allocation in the first chunk. Both the start and the end are expected > > + * to be page aligned. The area between @ai->static_size + @ai->reserved_size > > + * + @ai->dyn_size and @ai->unit_size is unused. > ^^^ > contam > This is for the math continuing from the previous line. > > * > > * @ai->unit_size specifies unit size and must be aligned to PAGE_SIZE > > * and equal to or larger than @ai->static_size + @ai->reserved_size + > > @@ -1581,11 +1931,11 @@ static void pcpu_dump_alloc_info(const char *lvl, > > * copied static data to each unit. > > * > > * If the first chunk ends up with both reserved and dynamic areas, it > > - * is served by two chunks - one to serve the core static and reserved > > - * areas and the other for the dynamic area. They share the same vm > > - * and page map but uses different area allocation map to stay away > > - * from each other. The latter chunk is circulated in the chunk slots > > - * and available for dynamic allocation like any other chunks. > > + * is served by two chunks - one to serve the reserved area and the other > > + * for the dynamic area. They share the same vm and page map but use > > + * different area allocation map to stay away from each other. The latter > > + * chunk is circulated in the chunk slots and available for dynamic allocation > > + * like any other chunks. > > ditto > Split into another patch. > > @@ -1703,7 +2051,8 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, > > * Allocate chunk slots. The additional last slot is for > > * empty chunks. > > */ > > - pcpu_nr_slots = __pcpu_size_to_slot(pcpu_unit_size) + 2; > > + pcpu_nr_slots = __pcpu_size_to_slot( > > + pcpu_pages_to_bits(pcpu_unit_pages)) + 2; > > I get that we wanna be using bits inside the area allocator proper but > can we keep things outside in bytes? These things don't really have > anything to do with what granularity the area allocator is operating > at. > The refactor keeps this in bytes. > > @@ -1727,69 +2076,50 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, > > tmp_addr = (unsigned long)base_addr + ai->static_size; > > aligned_addr = tmp_addr & PAGE_MASK; > > pcpu_reserved_offset = tmp_addr - aligned_addr; > > + begin_fill_bits = pcpu_reserved_offset / PCPU_MIN_ALLOC_SIZE; > > > > map_size_bytes = (ai->reserved_size ?: ai->dyn_size) + > > pcpu_reserved_offset; > > + > > chunk_pages = map_size_bytes >> PAGE_SHIFT; > > > > /* chunk adjacent to static region allocation */ > > + chunk = pcpu_alloc_first_chunk(chunk_pages); > > chunk->base_addr = (void *)aligned_addr; > > chunk->immutable = true; > > > > + /* set metadata */ > > + chunk->contig_hint = pcpu_nr_pages_to_bits(chunk) - begin_fill_bits; > > + chunk->free_bits = pcpu_nr_pages_to_bits(chunk) - begin_fill_bits; > > > > + /* > > + * If the beginning of the reserved region overlaps the end of the > > + * static region, hide that portion in the metadata. > > + */ > > + if (begin_fill_bits) { > > chunk->has_reserved = true; > > + bitmap_fill(chunk->alloc_map, begin_fill_bits); > > + set_bit(0, chunk->bound_map); > > + set_bit(begin_fill_bits, chunk->bound_map); > > + > > + if (pcpu_block_update_hint_alloc(chunk, 0, begin_fill_bits)) > > + pcpu_chunk_update_hint(chunk); > > } > > > > + /* init dynamic chunk if necessary */ > > + if (ai->reserved_size) { > > + pcpu_reserved_chunk = chunk; > > + > > chunk_pages = dyn_size >> PAGE_SHIFT; > > > > /* chunk allocation */ > > + chunk = pcpu_alloc_first_chunk(chunk_pages); > > chunk->base_addr = base_addr + ai->static_size + > > ai->reserved_size; > > + > > + /* set metadata */ > > + chunk->contig_hint = pcpu_nr_pages_to_bits(chunk); > > + chunk->free_bits = pcpu_nr_pages_to_bits(chunk); > > } > > > > /* link the first chunk in */ > > I *think* that quite a bit of the above can be moved into a separate > patch. > The last one was quite a bit of work. It is the first handful of patches in v2. The first chunk creation logic has been consolidated and the reserved region is no longer expanded. The reserved region needs to be a multiple of PCPU_MIN_ALLOC_SIZE and the static region is aligned up while the dynamic region is shrunk by the aligned up amount. This is fine as the dynamic region is expanded to be page aligned. If there was a need to align up the static region, that means the dynamic region initially expanded to use that space. Thanks, Dennis