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 4EE75C433F5 for ; Wed, 13 Oct 2021 18:32:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD35560F21 for ; Wed, 13 Oct 2021 18:32:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AD35560F21 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 360EA6B006C; Wed, 13 Oct 2021 14:32:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 310FD6B0071; Wed, 13 Oct 2021 14:32:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 226C06B0072; Wed, 13 Oct 2021 14:32:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 142736B006C for ; Wed, 13 Oct 2021 14:32:57 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BCD2A183F13B4 for ; Wed, 13 Oct 2021 18:32:56 +0000 (UTC) X-FDA: 78692260752.04.4685F3E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id CAB5E6001983 for ; Wed, 13 Oct 2021 18:32:54 +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=+EJxmu+T1BIqhiIOJWuhGDqZcE4ndy8HLbw9A/0h4f4=; b=VHKkv5R11KVH+FwBvQg5qduwr0 Oz49ocG0RcHt62vAEBIJzoHnxcIcY4wHr7yh/y/Q+ratWWGD50OoaP3FGRkDYQ8TGL5ZGtmxXCCZX HVITLTPmxOhNpE3UGl1NvZli5/6hxaeBspwIk7/h5SF2sx2Op8VGCEYJfEZaFE8TJukGZdXJYFBI3 EXljsDR3FJ6x4+imBVwPrSBOVdSQXnpySy3OA5h5QLi+IELgw2Dqq9SVxu5kwKxny6KcNLv7fIO4/ 2i7VVhUTXiRV37VmaKx04uOmx+60gtqpcGIsWvWIS7hvP11Qj2mjNIM1Aqq1fpD70u7siae6eL7D1 HhkYWf8A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1maj2Q-007i4w-Bk; Wed, 13 Oct 2021 18:32:01 +0000 Date: Wed, 13 Oct 2021 19:31:38 +0100 From: Matthew Wilcox To: Johannes Weiner Cc: David Hildenbrand , Kent Overstreet , linux-mm@kvack.org Subject: Re: [PATCH 03/62] mm: Split slab into its own type Message-ID: References: <20211004134650.4031813-1-willy@infradead.org> <20211004134650.4031813-4-willy@infradead.org> <02a055cd-19d6-6e1d-59bb-e9e5f9f1da5b@redhat.com> <425cd66f-2040-4278-6149-69a329a82f79@redhat.com> <842357c1-bec2-654e-c782-569b1fd627b2@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=VHKkv5R1; spf=none (imf10.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: rspam04 X-Rspamd-Queue-Id: CAB5E6001983 X-Stat-Signature: hdt9pcci5jxahebm9qdka87wp3c9yp8o X-HE-Tag: 1634149974-663293 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 Wed, Oct 13, 2021 at 02:08:57PM -0400, Johannes Weiner wrote: > Btw, I think slab_nid() is an interesting thing when it comes to page > polymorphy. We want to know the nid for all sorts of memory types: > slab, file, anon, buddy etc. In the goal of distilling page down to > the fewest number of bytes, this is probably something that should > remain in the page rather than be replicated in all subtypes. Oh, this is a really interesting point. Node ID is typically 10 bits (I checked Debian & Oracle configs for various architectures). That's far more than we can store in the bottom bits of a single word, and it's even a good chunk of a second word. I was assuming that, for the page allocator's memory descriptor and for that of many allocators (such as slab), it would be stored *somewhere* in the memory descriptor. It wouldn't necessarily have to be the same place for all memory descriptors, and maybe (if it's accessed rarely), we delegate finding it to the page allocator's knowledge. But not all memory descriptors want/need/can know this. For example, vmalloc() might well spread its memory across multiple nodes. As long as we can restore the node assignment again once the pages are vfree(), there's no particular need for the vmalloc memory descriptor to know what node an individual page came from (and the concept of asking vmalloc what node a particular allocation came from is potentially nonsense, unless somebody used vmalloc_node() or one of the variants). Not sure there's an obviously right answer here. I was assuming that at first we'd enforce memdesc->flags being the first word of every memory descriptor and so we could keep passing page->flags around. That could then change later, but it'd be a good first step?