Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2672658pxb; Tue, 12 Oct 2021 11:04:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztFD+zf+hwrzSlkAI9Da6FGFDdKMF7NgSMiCxAO3TQlTv+yKJZ8IJvXcvmAiXG6lfHyNXy X-Received: by 2002:a65:564e:: with SMTP id m14mr24230845pgs.113.1634061878003; Tue, 12 Oct 2021 11:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634061877; cv=none; d=google.com; s=arc-20160816; b=rBZfuY969oGPbNDF5onavZSz1J6AXni+3RB0oQIOGBD4XJtwN6V/pRY6pgmt5MfL/5 8LhYS06uonpjIxbMXwplNPZrlfmQCCVHwynMhB0qcIlO4AxYClB5qEQKT2WBsS2i1vS/ TEbgV+EHCeZJj8INtJ4Nowm6HfHTIrJdDTMZ9NzQGcrRELtNiEFKWi2zAn+UPjUx4kQm 2kp53OJR8eOhcNIaFJCJ5q+EwYRbQa9fzH8pUZlOmIwRuw9dM/TWZgRT647maly0FWCG 8zc+oIIRnSV3m/jnONOXK6GzK55/e3HqJoPb7GBgCqQbQ5c/8JJCve5+2XCIBJFxp7Gh YQWw== 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=EJleHbVtWFR6gqUGI4pMK3bP4aI2cTYgy4hO4rU19aY=; b=REstl7YY5SAjLpYHiJrz2I70fSmyX/mpFuD0gtWsjCgdjriVfAfMLAFIH3wEcuSoS0 E7VLSzOV63nRDqnNdW9JQuPm2hkf7uFKVDWbJu3TXW55BePAKbrcXrbwW8sDrpWqj7PR ApacUqnQ0H0gH1LpRAgiNvhe0OM54PCSpoc1QaPJzmYSuRn4luZ98sNaWCIniP8AAPUQ hSkMuPMH49Q5f+vBwlKXe9YQ+Hehk7NL8D/0ZJBxMTwgh0Z0HXXRYvAhCeXIrolkfabY 7hYG+NLisaka6qXqxt2yVotZgwWiMDQf0DPSJJKmTWuTfE7DF3P4xSEsA09MQkG4ntUM Tcmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=SzHk97+3; 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 g13si14519208pfc.151.2021.10.12.11.04.17; Tue, 12 Oct 2021 11:04:37 -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=SzHk97+3; 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 S233631AbhJLSEb (ORCPT + 99 others); Tue, 12 Oct 2021 14:04:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232404AbhJLSEF (ORCPT ); Tue, 12 Oct 2021 14:04:05 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2209AC061764 for ; Tue, 12 Oct 2021 11:02:01 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id az39so6532440qkb.5 for ; Tue, 12 Oct 2021 11:02:01 -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=EJleHbVtWFR6gqUGI4pMK3bP4aI2cTYgy4hO4rU19aY=; b=SzHk97+39EXkttB7Lcw0JFRnbjxuOzQa4QMcS+7Pnak9LUL8400Ch6IeQEO4X9RQYC SmUsHsHiEjQqsphLd2x9Jh3Y1GZBSxR57bLxQ93NhuCHeuPz5C8HlCXC/KAUylUm4jPG uJhs+iEHiloK/6bKOXSgO0ii+g4sdLCzkrSeh+a6LChSoa2c/Hv+oSChwRKqcNzb+wqF otALpvGvHBEq27rFOqPBpe+d1Wu68gC15DM+a/UgIfnIyLe0WpcAEUZLJBE63nD9EyZE ++nx+P0QcnjPPMhsIAYtUYtpvgmV+bwzHTtLCD9ds4ZI5yTFDjT7Mi0BQzG1w473Im5P MSOQ== 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=EJleHbVtWFR6gqUGI4pMK3bP4aI2cTYgy4hO4rU19aY=; b=2hc92JMQaIzrY667/ZrBY4XvDlsj6+w4S57+FxNCvcm7R/wqMUUC/fYo+ZCPXXyiut BoM2HqrJ2l539ZkykLEQM8FVvV9G+EwUmXaTo3nkDbVuTd188RQSu4LSkyK6sEqIjBRZ TUxWOunzH1oIRJHCrqx904BDP5uOKD5CvugOccA1rbqQ/vK+1N6XXua5jXyh7U9NPDed bNwJM7HddWrPoTxbddNo32wYo532aIeH67QPaAvhVTEq7MY76/4PUeuqBitVIhLQeq8Q +/6ms3dq1NvKiOjCqz8Q1UbCx7sbeQe0d7H14wUQ81tLU9p8JklfuvXR7ZlC4u8zy4ee yduQ== X-Gm-Message-State: AOAM533LW6ol2i0i0No9tT0cnaC3LJFRO2EIY6InytUmIcLbizLYjhZp Bqz8bG2rnpFolT2jRa+fTLPbrQ== X-Received: by 2002:ae9:de84:: with SMTP id s126mr21370083qkf.350.1634061720380; Tue, 12 Oct 2021 11:02:00 -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 t9sm7261733qtx.47.2021.10.12.11.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 11:02:00 -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 09/11] PageSlab: eliminate unnecessary compound_head() calls in mm/slub Date: Tue, 12 Oct 2021 14:01:46 -0400 Message-Id: <20211012180148.1669685-10-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 virt_to_head_page() implies it. Signed-off-by: Johannes Weiner --- mm/slub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 37a4cc1e73a7..d1bd004c8c2f 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3554,7 +3554,7 @@ int build_detached_freelist(struct kmem_cache *s, size_t size, page = virt_to_head_page(object); if (!s) { /* Handle kalloc'ed objects */ - if (unlikely(!PageSlab(compound_head(page)))) { + if (unlikely(!PageSlab(page))) { free_nonslab_page(page, object); p[size] = NULL; /* mark object processed */ return size; @@ -4516,7 +4516,7 @@ size_t __ksize(const void *object) page = virt_to_head_page(object); - if (unlikely(!PageSlab(compound_head(page)))) { + if (unlikely(!PageSlab(page))) { WARN_ON(!PageCompound(page)); return page_size(page); } @@ -4536,7 +4536,7 @@ void kfree(const void *x) return; page = virt_to_head_page(x); - if (unlikely(!PageSlab(compound_head(page)))) { + if (unlikely(!PageSlab(page))) { free_nonslab_page(page, object); return; } -- 2.32.0