Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2673624pxb; Tue, 12 Oct 2021 11:05:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzr4XezTwQ0qXZ3TvcuG2GX0gtoHx6bN2iNSFDH228kXuM93tyVe5RN0OlYG/HNockAlXBl X-Received: by 2002:aa7:978b:0:b0:44c:abf1:a8b8 with SMTP id o11-20020aa7978b000000b0044cabf1a8b8mr33189604pfp.35.1634061939553; Tue, 12 Oct 2021 11:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634061939; cv=none; d=google.com; s=arc-20160816; b=Mm0ypf6HDe8VDxAa9fDYKJwY5/jMa6ddDRRy3B9lNTuj1nrys0H5MKlK1iAkNQ/QBY TYvetbLrTcYIFUnxazVeibBQfEr6SqHurA5ImqJ4rcCaSuxopVOLtjR6+ZzmRnWmYLU/ LqiK9ykiT0oaDxUYCMsdQwGXYukUOCPd1G0Ha08gue07mWrE4mKisLqAjhJQhRnfZqrf idU2ocn1xwLJcBnAWXKNE4RyEkqleV3oR4gY+96pzdoboxezwoS3PnPRH0gRtsj6DhgS xoxns16ZXkUUvpQWdMlNviSpVz1SdoVRvvpAAcv7U1H9Glxbr7W6F2ZG5B5ECubu5k64 H1yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kIr58qV5WpRay8Un4aCE59erJsFKjxl5xtHUFfszgvw=; b=x6edYw+ChGvuDIriK2ZVRC5JJE5yXifRlw+3rEClF8/c5+ErEC1wTl2qhR/ZOOocU0 4ULgEgf4fr2ve1meMZfb9hjEbxdhZHZfc6XlxKUnFoLqlUc1xbWWj23nP/MrEnXNfteE g1H2NxfsNXdfA0DzmgNViK10Fn7A873s0BSUoLkTlTEcb02kVTReknfjr6cAfAthdI7B LElWZY5pfHkrmCH717ih/YQG5IBdXG6jSgAdT7t2lrI7CFoL+tZNXlWOWvsY5YBEBCqN YcgeBwRGkLFy1o7YiD58b2HvYspqRS6vP0jrA0y1sEx9LFyG6iNuaE7ZwMr01KlRNF6Y QO9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=APFcJCMw; 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=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c140si14359145pfb.42.2021.10.12.11.05.18; Tue, 12 Oct 2021 11:05:39 -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=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=APFcJCMw; 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=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233657AbhJLSEY (ORCPT + 99 others); Tue, 12 Oct 2021 14:04:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232810AbhJLSEB (ORCPT ); Tue, 12 Oct 2021 14:04:01 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59DB4C061746 for ; Tue, 12 Oct 2021 11:01:59 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id t2so142249qtx.8 for ; Tue, 12 Oct 2021 11:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kIr58qV5WpRay8Un4aCE59erJsFKjxl5xtHUFfszgvw=; b=APFcJCMwEwhUnWDhbjJl/47EYYCRSL66MqFK5gwiy/c+CsUcYNGXOxd9bxZdBy26Qq sQBYLREgxDAgtnn0OoS24xevjiCKpekpRPs9pcOAZVH+hHl3EShtl87yRMhzVt2xtPSD jPyEooMAjk1TTSDeYX5cvzvKmzcNYKSKE6mnhyVeDoeYYodo+YxTLbkAx78hS9pSGW7j fCKOPfVbm2QDM/7D5Odtb04yT6PJdR3tUXYXxv7GmkmzXV8+NIleM1elr4SukPwBYMnE owD6GHSShAXaSVgW+947pD2JY8B5PPv+oF1csX0yijtlTIO2sMHmRgJnxgMBKbg+lzn/ Yflw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kIr58qV5WpRay8Un4aCE59erJsFKjxl5xtHUFfszgvw=; b=zWnM/9GSSR2Af2Nghue5RCH3KsMCevZ5zDNCXVfl/GPYEpXoF/lajGqxRj+hazKle4 OkrkELznCLhsqmQwLwiXmxCX3UjKallu7nwI9us2rRelxkgssNAleUz34gBhiDcy1aGg S6HgNbAO2QZ9um50A9+cgjdXYnY6I4nGdirJvTIkRbzM9cWBbeqhfHBvWigV7iNUAYhU mRxlqIZX7QwAHjj0Rkx+cthjCemfG4CFP9x0lgFcFR1LZafz8l2ysghVfUWnQx90Y1uL 666R7Lj1i99IplQOTB3gnrtoVeOY+X/wMtfr0LTJ60SMeHKKDrGeMpkU83mx8L4OIUk6 +OLg== X-Gm-Message-State: AOAM5316EFAyzqrygsBdqaJYTOGKefvW1nKZfHCH/fyngYd+luQ1RFCw bOvX6/91mnFbdEk5/xBy3Regjg== X-Received: by 2002:ac8:5e49:: with SMTP id i9mr1670456qtx.145.1634061718567; Tue, 12 Oct 2021 11:01:58 -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 i67sm6157794qkd.90.2021.10.12.11.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 11:01:58 -0700 (PDT) From: Johannes Weiner To: linux-mm@kvack.org Cc: Matthew Wilcox , Kent Overstreet , "Kirill A. Shutemov" , Vlastimil Babka , Michal Hocko , Roman Gushchin , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 07/11] PageSlab: eliminate unnecessary compound_head() call in mm/slab Date: Tue, 12 Oct 2021 14:01:44 -0400 Message-Id: <20211012180148.1669685-8-hannes@cmpxchg.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211012180148.1669685-1-hannes@cmpxchg.org> References: <20211012180148.1669685-1-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kmem_freepages() is only ever called on the full slab, i.e. the headpage. Further, after the PageSlab() check, the callsite continues with a series of operations that are not legal on tailpages and would trigger asserts on their own already. Signed-off-by: Johannes Weiner --- mm/slab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slab.c b/mm/slab.c index 829f2b6d4af7..d0f725637663 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1396,7 +1396,7 @@ static void kmem_freepages(struct kmem_cache *cachep, struct page *page) { int order = cachep->gfporder; - BUG_ON(!PageSlab(compound_head(page))); + BUG_ON(!PageSlab(page)); __ClearPageSlabPfmemalloc(page); __ClearPageSlab(page); page_mapcount_reset(page); -- 2.32.0