Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp123951pxb; Wed, 22 Sep 2021 17:48:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxECBHHCgnD3KLHRrga2fulOpAl51VXLhlkaVVRK+bApNutga46mseuvwuZExcdnKB/1TKR X-Received: by 2002:a17:906:b46:: with SMTP id v6mr2200289ejg.262.1632358103600; Wed, 22 Sep 2021 17:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632358103; cv=none; d=google.com; s=arc-20160816; b=COnrBOI2JYM6XmuLpRQum0Uy2aCVQjDfn2GvoRSDIgk2/1dCRoB+RqdUHCeZNGe/s4 4yuEhXZn94Yqev7fn2KGYpd7kl8sWzF+wYXmA61ufBXPsnhyMx/JUwlYRU1yz1tONCVl x9a+yUfl2ESrDhwBE0WE4QoWYlkjt/5o+jgXFJJg+hrOqJCBUiwcRiuWi9k8jII9YQ6o +jRx2ZYW5ly07+aJaK9CwFpl1iWo8AwOtdvXEq02UuEAY7nUsQIq9MBCIDp2ZMY6SdIb 6y2zrou+05QNEnSj7TArOUd/1vcW6LOCcr7ZNKatc4z9tAj7zTjx10hbl1xWjnUnb6CM mdwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=h2Oc7prPrz2GKEnYE7ybx2HBydEi9heZG2dHF1BJWRw=; b=KCx+GXZA5jYUuuHZsKuAh7E38Zo6xxRSQLC3KcvIp34tphadkwRTP7BKcYOmg2Wf7F 5G7eRN9oNunAuojZEFPRxiIVC9/XxQl6g3F5KxVOxCXcDxTsogLxIl5n27gXxudHnmoS Hf9k6ElCxrt18wfXCOLU9CS/cHt0aTNCZzS0z1RrrSZOMIvEtEqJGE70P8KMTjl3vTQi IK1hL2jWuDpk3m+iC+iv+4gRTvGFHxv55RLUa4PYtghMs0ojlGzyCQB+XNbJ2Wtx86Ht mA8YAFJ6I5TRqAGkEgTj5QlFZBFHz9a9Mq3/t7BWChNwqjcK3kRK00ofBapw53ELLoSe Qijw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx1si4251765ejb.310.2021.09.22.17.47.58; Wed, 22 Sep 2021 17:48:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238748AbhIWAqu (ORCPT + 99 others); Wed, 22 Sep 2021 20:46:50 -0400 Received: from mga14.intel.com ([192.55.52.115]:14258 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238631AbhIWAqr (ORCPT ); Wed, 22 Sep 2021 20:46:47 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10115"; a="223381050" X-IronPort-AV: E=Sophos;i="5.85,315,1624345200"; d="scan'208";a="223381050" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 17:45:15 -0700 X-IronPort-AV: E=Sophos;i="5.85,315,1624345200"; d="scan'208";a="474900207" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 17:45:15 -0700 Date: Wed, 22 Sep 2021 17:45:15 -0700 From: Ira Weiny To: Matthew Wilcox Cc: Kent Overstreet , Johannes Weiner , Linus Torvalds , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , David Howells Subject: Re: Folio discussion recap Message-ID: <20210923004515.GD3053272@iweiny-DESK2.sc.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 21, 2021 at 11:18:52PM +0100, Matthew Wilcox wrote: ... > +/** > + * page_slab - Converts from page to slab. > + * @p: The page. > + * > + * This function cannot be called on a NULL pointer. It can be called > + * on a non-slab page; the caller should check is_slab() to be sure > + * that the slab really is a slab. > + * > + * Return: The slab which contains this page. > + */ > +#define page_slab(p) (_Generic((p), \ > + const struct page *: (const struct slab *)_compound_head(p), \ > + struct page *: (struct slab *)_compound_head(p))) > + > +static inline bool is_slab(struct slab *slab) > +{ > + return test_bit(PG_slab, &slab->flags); > +} > + I'm sorry, I don't have a dog in this fight and conceptually I think folios are a good idea... But for this work, having a call which returns if a 'struct slab' really is a 'struct slab' seems odd and well, IMHO, wrong. Why can't page_slab() return NULL if there is no slab containing that page? Ira