From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47941C433F5 for ; Mon, 27 Sep 2021 18:07:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5ADCF60F4F for ; Mon, 27 Sep 2021 18:07:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5ADCF60F4F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id CDF3F6B006C; Mon, 27 Sep 2021 14:07:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C8E6A900002; Mon, 27 Sep 2021 14:07:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B55836B0072; Mon, 27 Sep 2021 14:07:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0078.hostedemail.com [216.40.44.78]) by kanga.kvack.org (Postfix) with ESMTP id A22C06B006C for ; Mon, 27 Sep 2021 14:07:11 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 639C931E4E for ; Mon, 27 Sep 2021 18:07:11 +0000 (UTC) X-FDA: 78634135062.06.ED7AFDB Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id 922511908 for ; Mon, 27 Sep 2021 18:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KIiyuFcQAjPzsk642oitN3a7sbbUrS6ZmU/9sdezjAU=; b=UDzuHesmpTLHLvrdN4ldNTBtHt 9j9vJ5YaXpkIqvR31CxwzuMi54is5yAHiA8wdIeOIjjutLmmUGSapiJarbT88qB1XATx0/kE38KLE H3PZOEsCvA5WDbbZid7vlVZpD+UmFqjsFdQSEGBEPt5vZRRDVxYtAWYtUo5opRDWFiVHKVV+yqGvG nuBvrSh0fWwIyLAFyMgb/r090kLxIHtRohmPR70tkynQKEKi6XghCgnnGBSUg2ISPPezgEyRQHz1x pjhaj3iTMGLs28BwfSdjyJTq/p7tU+vKa+YSeMEgDLLMiZ/NN1c75akHC2JzmSRdZn/1h8XLHdg1t mMa252cA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUv0I-00A3WT-Kh; Mon, 27 Sep 2021 18:05:35 +0000 Date: Mon, 27 Sep 2021 19:05:26 +0100 From: Matthew Wilcox To: Vlastimil Babka Cc: Kent Overstreet , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Johannes Weiner , Linus Torvalds , Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , David Howells Subject: Re: Struct page proposal Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 922511908 X-Stat-Signature: bo76rfoz1tpq4bio7udknazt6m5chj6r Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=UDzuHesm; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam06 X-HE-Tag: 1632766030-356840 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Sep 27, 2021 at 07:48:15PM +0200, Vlastimil Babka wrote: > On 9/23/21 03:21, Kent Overstreet wrote: > > So if we have this: > > > > struct page { > > unsigned long allocator; > > unsigned long allocatee; > > }; > > > > The allocator field would be used for either a pointer to slab/slub's state, if > > it's a slab page, or if it's a buddy allocator page it'd encode the order of the > > allocation - like compound order today, and probably whether or not the > > (compound group of) pages is free. > > The "free page in buddy allocator" case will be interesting to implement. > What the buddy allocator uses today is: > > - PageBuddy - determine if page is free; a page_type (part of mapcount > field) today, could be a bit in "allocator" field that would have to be 0 in > all other "page is allocated" contexts. > - nid/zid - to prevent merging accross node/zone boundaries, now part of > page flags > - buddy order > - a list_head (reusing the "lru") to hold the struct page on the appropriate > free list, which has to be double-linked so page can be taken from the > middle of the list instantly > > Won't be easy to cram all that into two unsigned long's, or even a single > one. We should avoid storing anything in the free page itself. Allocating > some external structures to track free pages is going to have funny > bootstrap problems. Probably a major redesign would be needed... Wait, why do we want to avoid using the memory that we're allocating?