Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4186306pxb; Mon, 27 Sep 2021 11:09:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYQfKkAq5Fbo94RoYDlEJtBtSpKQEeiqRt6Ved/U8Lh9pGSgicIhQFP0nUF4z9NPgf5cHc X-Received: by 2002:a65:620d:: with SMTP id d13mr896691pgv.36.1632766192121; Mon, 27 Sep 2021 11:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632766192; cv=none; d=google.com; s=arc-20160816; b=RvUoqzoXNhcgfYW4Fd9e7B/4eoHuUycrR9tDOQTlXJalQUnSiM6OTX6gweQf9Fznyy lisH4LLiH7tgLdN1Y0mfxA74EFD4na5/4SG656pbJ89uHJpwnue6N907dDR+GZtNp8uJ wsN12kX3UbfXQyBAzlkPzYlq07oQkERrjCIiSgq0oYHhb/atG44QkFFJNeKGG98mXm7N qkNEgpY6Tu+e5eNdlc5az8hLpZFT4z0la4eOUcsIGBtK26cL82wYxbpNzENUUNwLE/B8 4mHNnIl7kGbZslxD/BT9QDjgKcX+6Gh1X0LYENNi+A3yjku4ocLgn1R/Ii5J63JfSNxo Y0VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KIiyuFcQAjPzsk642oitN3a7sbbUrS6ZmU/9sdezjAU=; b=cwlT1VelaiuntGeUwHn/NJK6dNg9Wvf3fekkgU8TS4p+gZyQ3X2rtMLtE3/aaI3Nrn FSZyV7JHbI5ifuG4hp5VFVZj1UkAm9aR4N+8aVic0u03fHJ1sFYfk7Gv8wDTF3yS1eqp vtiM6AfiPKrM6iS9qc++yC1lTSRDI0rrEHA3//oBKv5a6o1DSsF12EUK7oGCVAwr9Ksg W/UXNvnKB4St3ZydVqP+nFlGnA815uLFzgZwsC01AGNxzbnNBdXtKu6ufyWklAkwbqPW 27YQgkq0LqbBzNGVjEYXkdCEana5yy3Rf9aASfIU0BQAX8QdnJ9K51z3uTprx2Z4hkD5 Kqbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UDzuHesm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c21si21360952pls.149.2021.09.27.11.09.27; Mon, 27 Sep 2021 11:09:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UDzuHesm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235816AbhI0SIt (ORCPT + 99 others); Mon, 27 Sep 2021 14:08:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235400AbhI0SIs (ORCPT ); Mon, 27 Sep 2021 14:08:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79C9DC061575; Mon, 27 Sep 2021 11:07:10 -0700 (PDT) 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?