Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4174191pxb; Mon, 27 Sep 2021 10:55:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwg1bz4jdb1e6LZL7YhYP5JxQxnclwM8FwFgQ45XWiQkdLNlH13dlyKIhTfMVKdAu3TmaAA X-Received: by 2002:a17:902:dad2:b0:13c:a6ce:faea with SMTP id q18-20020a170902dad200b0013ca6cefaeamr741400plx.45.1632765304643; Mon, 27 Sep 2021 10:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632765304; cv=none; d=google.com; s=arc-20160816; b=ZgIWLKGpd7n/uoZxNbPW2SVaxstVC+JyDQ3yOaqiFLL/lCZcEwnZye9GSq5VWZpjx4 R8XXF1cb0bg3x5abJqqpnesVc125mDmPUF66Vf+M95HHa4PYU5J5OeWyGUd/ZK7juLMt uqGXFeAT+91xrZGtR2+cwWVlGBpeESaSph/fA+m3/szZcvV2HT718argeWRTXF4eAjDO 7OMq4+5SHX8+SwqwqGwLj6dkXt81RlACcZn1rvzLO+qxNIuo7AZeNR5qqADyXQWQW4KC qhdRO0SnRprlHRWfq4MCMrAY9nUKraEm5bC9bi2Fxg3zMl0Ifc/oF2XoM0Hx4S82deqG DxrA== 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=nqerXrbMIY7Fc4sCLQnr/8c/NFYmTrN8ExKx8Kwlvs8=; b=HtiUd22q+Q++E/QRbnz+DfTYdLrS5V6gCeFTLcUkFXE5fzV5ul+HUe7v9Y8D3vt7xz PmamDZyCA3rFr3d0u2Z0BpqXdldjakjrwcy94b1b5EwXwXV8nB71nHlVrCbh7WeOQRRv kJODUQuSZITzFr5IBhOlY76tlip+OEiDdsja8rSbM3JAEBs9R5vwWzHiLCC6IHditX7Z HKcz9v/U6EWaZbgaaeL+wfFOYr2lxuF69ARh4B4dcc1EL5lPVhfr7AmW++VFZgAlZ9X8 zdJ7ob42G6ZSJQ6Qp/32Wnj0haVyw82K4PWOlo+Q+02qMO3Nd/6yBE2SPYs25NfI5gin lIoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TE8FrUk5; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si22631263pgj.268.2021.09.27.10.54.52; Mon, 27 Sep 2021 10:55:04 -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=@gmail.com header.s=20210112 header.b=TE8FrUk5; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235595AbhI0Rzk (ORCPT + 99 others); Mon, 27 Sep 2021 13:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235500AbhI0Rzj (ORCPT ); Mon, 27 Sep 2021 13:55:39 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 690AEC061575; Mon, 27 Sep 2021 10:54:01 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id 138so37385623qko.10; Mon, 27 Sep 2021 10:54:01 -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=wZTF1wjI+mHuAEASAbkzl5HUjhZbHU2d0V+QajLMpKs/YQn5S0HfI1+vo43Fq3GzzW v1aOa7hDBkszdAHvHO+aStXxaRtPSzao2Vaag84fA9zxJk2MPd8ea2Er5bE0bKGhL6e9 H+OXRSf9b1dAoZiitpn404RjVXeqlQ9t+0/U5kps89a6yn1vjtF4euJLsV84aSRIu4Ru rCqBX4eO71jqfmKvgJ3gOVPy8QTFtUxMkEYngs3UhMz1J1AfX+wHW4gyNbEQ5CG8bNeP QjypCWBtKXH+SDU7FdWGVsGZiPt5C5+sUibhXl++PQRs4QswfPVNkpn4Ixm3mNRoiJIL jfHw== X-Gm-Message-State: AOAM531wDfh0zAZem6biaTyJ5QRJ74yP8VwToHy2aQsQ7Qd/ixqBZAg3 fjjWBhZXGzhQ5lXeqc8BdWjEdzs9L8VJ 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: 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 That list_head is the problematic one. Why do we need to be able to take a page from the middle of a freelist?