From patchwork Tue Oct 12 18:01:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Weiner X-Patchwork-Id: 12553425 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 168C3C433F5 for ; Tue, 12 Oct 2021 18:02:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B4773604DA for ; Tue, 12 Oct 2021 18:02:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B4773604DA 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 E6BEE94000D; Tue, 12 Oct 2021 14:01:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D815E940007; Tue, 12 Oct 2021 14:01:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C1F4494000D; Tue, 12 Oct 2021 14:01:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id B34BC940007 for ; Tue, 12 Oct 2021 14:01:59 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 73D712D4A7 for ; Tue, 12 Oct 2021 18:01:59 +0000 (UTC) X-FDA: 78688553958.27.A2D5943 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by imf22.hostedemail.com (Postfix) with ESMTP id 364691903 for ; Tue, 12 Oct 2021 18:01:59 +0000 (UTC) Received: by mail-qt1-f170.google.com with SMTP id r17so130028qtx.10 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=FPLMqQCxabKYV6A5WffpUVDzHNialwoHOYS1MdanslWnfRpZQMoMQcmDZUYJtbglom RZk3caK/ZkM817E0CYZKCDcx030rYgDh3TyzQ72OUqfnmRX5zGzS858srtuZ5uNOx/Ma xsxTez72S3t4TJPrXde40MH+5ovsCEBz/6ruAq1ufAmf+h5+wqqkLFjLwxW6j4Si8CzJ HOY0q+Ib7l+k8i/2a4vh5sl6Kyw13hUZ7M14M0+nxKGoE6mnOFLWgdJXzO4DgsVEDpOZ 0qXTD0IWnAwTk1RlKnjcGBGIxJ0SvIpXMWy4CQiw95CcYjJylguqUGIdfIA26Re3RIpM Rc1A== X-Gm-Message-State: AOAM530LTN1dfig1Mdjdm5PZQR8aCMtHlwkvsw5qHK2WGQPkwxPhDPr3 dCnTBEOC7n+NFSOlLhrtwtw2XWFhUb5brQ== X-Google-Smtp-Source: ABdhPJwASH6CVRSFTgQo/VwOt0e0q8DY9ofHco7CvmtZqHAxJ1tq9C/Qvq6u9Bbcz1hr7c2/HMKJeQ== 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 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 364691903 X-Stat-Signature: 6u6ymkb1ewai7ojqics5zk48qcoksmce Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=APFcJCMw; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf22.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.170 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org X-HE-Tag: 1634061719-605159 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: 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);