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 429D5C433F5 for ; Wed, 13 Oct 2021 18:09:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8DCDE61053 for ; Wed, 13 Oct 2021 18:09:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8DCDE61053 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 132E86B006C; Wed, 13 Oct 2021 14:09:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E2BF6B0071; Wed, 13 Oct 2021 14:09:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC4D46B0072; Wed, 13 Oct 2021 14:09:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id DA1176B006C for ; Wed, 13 Oct 2021 14:09:00 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 985171804D8B6 for ; Wed, 13 Oct 2021 18:09:00 +0000 (UTC) X-FDA: 78692200440.03.3DA940A Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by imf09.hostedemail.com (Postfix) with ESMTP id D4B2E3000107 for ; Wed, 13 Oct 2021 18:08:59 +0000 (UTC) Received: by mail-qk1-f170.google.com with SMTP id bi9so3052520qkb.11 for ; Wed, 13 Oct 2021 11:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QT+UWsmDsKHmjf1umiZHxspqCdj/8QSI5e7uovjEn1Y=; b=qlKdMWSRjftWmT9nBI2CW3hZQNUs90c88YlrcfzdlxX591rnfQZlyrJjznj+xSk0Ny Cn9c3/QFdAkqXSSw2GAvNAKWPwIViNONy1H2y7FB8eO42sV7beoFCB5VwYoy9rvVIopq CJP2uQSSJDGzknYyxg3fjNctPTFn2SS7mPLp2fXTBmTWCh0O0vfgcohugGuw3ZRCfgSq iiEUz/Qtn0BJbx8v3SHDc5bK2tY0v2J+KS18XUM3OACKaYWHE7s0iSLMtS9tdc9NZEql hi8HY6NKLCtQvVCMcBn8TIhjYYzsvZGf8GOUHU7777aIbCjLID7nTXC6rHHG8E/eDT75 HwFw== 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=QT+UWsmDsKHmjf1umiZHxspqCdj/8QSI5e7uovjEn1Y=; b=R3pqkx/gRWqU7UONbrJSVrZjbPtP5j7rIhFLJepLB8RQz8FdS2wuL42kwTovjRTw4L evLsVq8hPQmnbiaBHQzTwlNhYPgyBIVy7CVm+sT9OLtKBetO5B0kX4C2svexLZTWUIwv A95YQwcQRUWEqHhI+Tb/S3Tgs/6YePetP5Ry3kcSUW4x+KL4q++ZZ8KAHnVSI/hmhLks IRLsqr1tddnDVUdWo7Ji/jFAfY6PhTBg5UmSxqX8C3d5WCCC1yWP23G0jwNXD9XNLr1+ n4eiTIL6A3DuSP2aJXgqGL8T7T9UN3hTY0vG/walvhWWmmTjxRRZgpU5Z1AK1mL+8mp9 +Sig== X-Gm-Message-State: AOAM532j09jDdKalgrqsbKcK6Vnw+2xnloO/OhAgrZcO8BV3LQPvlqdv cRN9qe3yDQAufVZh7xvfZfkCSQ== X-Google-Smtp-Source: ABdhPJxagrmXZwZqulqGuXZfzWuO7uLw3snVquWEjpexqi7xej2wjV3R/DUkTIDWVeesKtH4vOETfQ== X-Received: by 2002:a37:643:: with SMTP id 64mr698466qkg.412.1634148539107; Wed, 13 Oct 2021 11:08:59 -0700 (PDT) Received: from localhost (cpe-98-15-154-102.hvc.res.rr.com. [98.15.154.102]) by smtp.gmail.com with ESMTPSA id z13sm204756qtq.30.2021.10.13.11.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 11:08:58 -0700 (PDT) Date: Wed, 13 Oct 2021 14:08:57 -0400 From: Johannes Weiner To: David Hildenbrand Cc: Matthew Wilcox , 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: <842357c1-bec2-654e-c782-569b1fd627b2@redhat.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D4B2E3000107 X-Stat-Signature: expr7ahiab335k9fnac7bcyau9xquqcw Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=qlKdMWSR; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf09.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.170 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org X-HE-Tag: 1634148539-720317 X-Bogosity: Ham, tests=bogofilter, spamicity=0.020534, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Oct 12, 2021 at 04:17:29PM +0200, David Hildenbrand wrote: > On 12.10.21 16:13, Matthew Wilcox wrote: > > One of the things I did in the folio patches that I'm not too fond of > > now is: > > > > struct folio { > > union { > > struct { > > ... > > }; > > struct page page; > > }; > > }; > > > > so that I could do &folio->page instead of casting to struct page. > > But maybe both of these approaches are just bad ideas, and I should do: > > > > static inline void slab_clear_pfmemalloc(struct slab *slab) > > { > > PageClearActive(slab_page(slab)); > > } > > > Yes, that's what I meant. That looks great to me. It abstracts a slab attribute, but is very clear in how it implements that. The dependency between the data structures is more obvious this way than with unions, which I think will be really useful in further refactoring iterations. 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.