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 ED566C433FE for ; Mon, 27 Sep 2021 17:54:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 97EFB604AC for ; Mon, 27 Sep 2021 17:54:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 97EFB604AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 28DA96B006C; Mon, 27 Sep 2021 13:54:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 23CFE6B0071; Mon, 27 Sep 2021 13:54:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 104FA6B0072; Mon, 27 Sep 2021 13:54:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 013706B006C for ; Mon, 27 Sep 2021 13:54:13 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A21B21816BB61 for ; Mon, 27 Sep 2021 17:54:13 +0000 (UTC) X-FDA: 78634102386.01.97BE50F Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by imf10.hostedemail.com (Postfix) with ESMTP id 53F016001980 for ; Mon, 27 Sep 2021 17:54:13 +0000 (UTC) Received: by mail-qk1-f179.google.com with SMTP id c7so37968098qka.2 for ; Mon, 27 Sep 2021 10:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=nqerXrbMIY7Fc4sCLQnr/8c/NFYmTrN8ExKx8Kwlvs8=; b=TE8FrUk5bml6qC0WPBvGqevs6HjtGjjFSibyoRLQoJhgGw4ygE4LKDcQ2ADs2EIe/i iERiMqB9ITpJP0Jh6I6jpLQhQ9eca1vWWpskeqAMjiHWOjuin3OGRMGK6vV9mEWLxsFI EVkgTV7aji0uSeyyqYguJ+NjNs52hbchpsx0ASu7w5mz/NrU/YKe+v2gx0j/io9ltame p0FJ9Sn+i7vZOowRdEB0lRDGxnZwvxGtrVpY3Mz0iPDcSuJKSzfqUYRhOwRlaR9Q/BdQ Ajki3L7JCzd2WmYpaOlM+YVBPNo4tkoUZkFsH9h6DBJyuZh39a53AOpVu38A+TA/eDQ1 +RXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=nqerXrbMIY7Fc4sCLQnr/8c/NFYmTrN8ExKx8Kwlvs8=; b=K4rpJ/3zLffhFIybhjme76AlfaVJJtPZ0Id7Sx69WGC6ak/bRqjUBrFI14JRfiKfWO mimJ1p+7IQXWt6O8kjUfxh1QT1xbTKGNUH6D2BK66vp3SFX3kUVFBog9f/0AamAFOA82 mKXrPNfUUdXptbD+UtyLhxn3ApeIuhFNIbExg3xOtYvftSmMmO84Et753uCt9MfVz3W6 QCtx/CnlfG9lEJRun1nT4CrGJIpuy8RTnJvXpM/vqNGDz8PVp2Y9L8+3PMV91Ksq+96h TbqyD5oaxh67BYEE96NyN3gDAhKy8VW0ue2K72W988YqNlzbGJSow/ZIVBzzzBWQnh2W 0+oA== X-Gm-Message-State: AOAM532viy279VDaYfpyQB/WgeJiyvgiUeAGGRn+5laSgW1EJA8/PSUb 5DBUhyQ9QSGxVsMVX2ozoA== X-Google-Smtp-Source: ABdhPJzZhyAO48ZaPX93fi6kWxPici07wMQhSc6zubPsWsqInS9hfyUbEyszSjTeFooceBJBxn+d7Q== X-Received: by 2002:a37:44cc:: with SMTP id r195mr1257805qka.77.1632765240635; Mon, 27 Sep 2021 10:54:00 -0700 (PDT) Received: from moria.home.lan (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id f10sm13094136qkp.50.2021.09.27.10.53.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 10:53:59 -0700 (PDT) Date: Mon, 27 Sep 2021 13:53:57 -0400 From: Kent Overstreet To: Vlastimil Babka Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Johannes Weiner , Matthew Wilcox , 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-Server: rspam02 X-Rspamd-Queue-Id: 53F016001980 X-Stat-Signature: pqrkdb1z7mmz5dmrmqgdttcdd7y6pryc Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TE8FrUk5; spf=pass (imf10.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.222.179 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1632765253-510719 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 That list_head is the problematic one. Why do we need to be able to take a page from the middle of a freelist?