Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4171063pxb; Mon, 27 Sep 2021 10:51:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+00FyfDmRn09LnqcT8lwFn2lOiEVLmJJh5JMqqMZNLFz3hT19ZJUivr4asr/zrxQLYhPn X-Received: by 2002:a63:950f:: with SMTP id p15mr761565pgd.265.1632765066855; Mon, 27 Sep 2021 10:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632765066; cv=none; d=google.com; s=arc-20160816; b=gK43qKi/OcoIzbg2l6lhaS1O8Hd9uGgpiLF/oDlx7VPXEvYoDqDmQN92TurjZ1TlMr 2m52s6YyI6648d510btPpX/Mg90OUs5o3dq8OzNt9Tq6mOrHefT1ZACW8zFe2M/L2dhy 06Fy4J6o+TQuvLehl8ztnlKnOyvwjbSWsgpfKiETArZaSraCu2X+01lADy63EqOgW5eb s3HorejMVy5BjKXPjPfTSG0k3yhzCrj2W/ViByltLrrbddjn5cH0g+HKOMVGq3Q9rmAU Jbd/SowLi4cOh2BwzNYhxfPt3DVL5Dhg4lEl39Ez9vt4wQPpt2PDXGWOpPZPWM93v5wZ JZIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=UvaIb84bs5CgKY5BLmHg7hDoz9uS7G9WON/VtG1lE74=; b=ttcScJpvPOuu+gU3aa1U5aJW73I8Imqq3JmIfeJT9SzDX+jLTsxPJ7mq/ypVpRXtOt 6Jn8b7S7eC/SU1ePuRKtTY6Ai8r569NRg25DMb8riOhYhNdRw88lanOgqQr2BHHWWW7l s220FLzFb/mlSWeNMeXO/hm3vq57Ud0jv6K7W/DxLVsKBgKBg+MLFSepmvI8gyT6p8VG 9Qiym2Nwqq40G4pU0OyAMM/bxwZAB757eg5QpWifa0RMzgAsp2/0mifP/vfVMH909Mo4 X06H+mBifqrOnVkYn0phc2oLE8iQYPhuYg6KFf58b0v4p4xQw/qe7oJSTiUHGMQS8+OU 9/Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=CjuOevw7; dkim=neutral (no key) header.i=@suse.cz header.b=Denipbno; 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 u63si17802614pgd.489.2021.09.27.10.50.54; Mon, 27 Sep 2021 10:51:06 -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=@suse.cz header.s=susede2_rsa header.b=CjuOevw7; dkim=neutral (no key) header.i=@suse.cz header.b=Denipbno; 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 S236447AbhI0RuV (ORCPT + 99 others); Mon, 27 Sep 2021 13:50:21 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:51452 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235942AbhI0Rt4 (ORCPT ); Mon, 27 Sep 2021 13:49:56 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8FBE320192; Mon, 27 Sep 2021 17:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1632764896; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UvaIb84bs5CgKY5BLmHg7hDoz9uS7G9WON/VtG1lE74=; b=CjuOevw7QHHLIbmgMINaDx0qqfZZyQvCXYgJwvNuLGBCBZ1NG6UeG6BcmXOO+byn5U2p4h anSg3DnUK5Gtndnn5szyops0DQ+dui5D9bl84dmHn1CS81DzC8zBU+My//HAoe6sk9e7ek i/lFD/hQv3QgEpYoeaHVwYaqMW3q2ZI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1632764896; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UvaIb84bs5CgKY5BLmHg7hDoz9uS7G9WON/VtG1lE74=; b=DenipbnoSkR7n8VIdteCv23hMvy9k/bn16u4tyXYAwDWjw6QDusoHbcq1+XG/HY0sL8E7q haY7qLweQf0CtQAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 650B6132D4; Mon, 27 Sep 2021 17:48:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gGTZF+ADUmHNHAAAMHmgww (envelope-from ); Mon, 27 Sep 2021 17:48:16 +0000 Message-ID: Date: Mon, 27 Sep 2021 19:48:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Content-Language: en-US To: Kent Overstreet , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Matthew Wilcox , Linus Torvalds , Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , David Howells References: From: Vlastimil Babka Subject: Re: Struct page proposal In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...