Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1105639ybh; Wed, 11 Mar 2020 17:43:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv7U1khyjeXWoitJGSjH4gVPVOA0sLOqj/DGtiYM6TAPSKaUMbu4oN1swKpe8fuFFVJahBA X-Received: by 2002:aca:7506:: with SMTP id q6mr885924oic.73.1583973824060; Wed, 11 Mar 2020 17:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583973824; cv=none; d=google.com; s=arc-20160816; b=ZE6Sx+j5Jfu6ZdOTt9P6/wAWvy2LTnwTz3m4NKNpuSt1oS1cKm9XsGpfoFugs2X5xH ChpMwEIyxCb8SSW4LHVnUqQu4Ner3lykiM7wUkDEnVoTEPXJa/ylMDutfpbRQVCTk7v2 jWEF82NdZ82meIdtCumOcWHiGE2wraay7iYGLfYEM2DbeI47t9UEXbKPYt/f5aPeg3EX KZmFtLhT0e6BLxA5XrAy7GGwbnETaQlzUTBljTIvQ/yPXp78V7B1sUq6OqLxxt3qWI/d KXjvfVAPENCAsKJ7C6GnxDf/wgQWY9GNaJkFUW0DtCo5GXJtuufJBOaqmA3xiLdFIvQF aTOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Y41Y+jrQy+VIlUTlJAa0wRdH7Fuo67XTY3rpVZsXVlc=; b=qvuJD8ts8TLlih+RXoQaLigBbBxQnSrAVSrrfn8bktFxs35tZhe0nYHwnJ4lKP1Rt7 85oXbsSs27K/wPFZF6l+r2/tUexMeZiMKrNVRnkX93gTYuWDI+GL+6OJTi3i3ZTDmeoi pcnwLdP/cqxwfTYFJh0xCECjT4qrMVGanupbQ693M1DrmrhSGGbSjVAqADyV1i4f72ZV wZ9SC4BsCe9sIm3oiFQq3KnTM0p++Gc0aR3AYpO0Z+XABU+cPkuZqPMa4Hsu8zrVI2TT bwb2ARx5o9Dud14/X6iaigCJ7qBHNLUEqlJRl2Yq/aFgoGlpYcdfevSR57sfBoVP6meW Quvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id t24si1968131oth.319.2020.03.11.17.43.32; Wed, 11 Mar 2020 17:43:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1731594AbgCLAmz (ORCPT + 99 others); Wed, 11 Mar 2020 20:42:55 -0400 Received: from mga09.intel.com ([134.134.136.24]:28947 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731555AbgCLAmz (ORCPT ); Wed, 11 Mar 2020 20:42:55 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2020 17:42:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,542,1574150400"; d="scan'208";a="246203295" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 11 Mar 2020 17:42:53 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 5569516D; Thu, 12 Mar 2020 02:42:52 +0200 (EET) Date: Thu, 12 Mar 2020 03:42:52 +0300 From: "Kirill A. Shutemov" To: Vlastimil Babka Cc: Mike Kravetz , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/hugetlb: remove unnecessary memory fetch in PageHeadHuge() Message-ID: <20200312004252.efb3bfirdk4ghe4z@black.fi.intel.com> References: <20200311172440.6988-1-vbabka@suse.cz> <20200312004119.b7uew2jriwx2mks5@black.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200312004119.b7uew2jriwx2mks5@black.fi.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2020 at 03:41:19AM +0300, Kirill A. Shutemov wrote: > On Wed, Mar 11, 2020 at 06:24:40PM +0100, Vlastimil Babka wrote: > > Commit f1e61557f023 ("mm: pack compound_dtor and compound_order into one word > > in struct page") changed compound_dtor from a pointer to an array index in > > order to pack it. To check if page has the hugeltbfs compound_dtor, we can > > just compare the index directly without fetching the function pointer. > > Said commit did that with PageHuge() and we can do the same with PageHeadHuge() > > to make the code a bit smaller and faster. > > > > Signed-off-by: Vlastimil Babka > > Cc: Mike Kravetz > > Cc: Kirill A. Shutemov > > Acked-by: Kirill A. Shutemov > > We use literaly the same check in the function next to this one -- > PageHuge(). Ugh.. I have to read the commit message, not only the code :P -- Kirill A. Shutemov