Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1105421ybh; Wed, 11 Mar 2020 17:43:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsm1SxautINO2KqqtXQxedSiJN904SsaYr1v7PLwIq7LloI6L1RSGgWjeIJoH1v6jwuTo61 X-Received: by 2002:a05:6808:195:: with SMTP id w21mr907874oic.77.1583973803086; Wed, 11 Mar 2020 17:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583973803; cv=none; d=google.com; s=arc-20160816; b=APHeYHHDIq6Xp1aqoCcHs1hTXV29u500OhIMCrtrC0o65lHSaug3hqxmFB3HWNxk5C depTxiUNss8L70fGluhK9QlQ4ZLQ5cRxynZBW3LQW34HUWwznNteq2jc5nGUyLTTSVue +i245jXdY63Hh7RHnUi7FgORcciod49UYQ4RP8oMq4dVuHZnLkWC3TfKjxefDii1SWBA k/H9aqGVal305n15WLkIiJERVBHikE//z9shIXd0a1w/TsYAAhabPvnsyCofAbOXXGlL MufA2WXD6byhStPuc1XBOYDH57Iab5mmHqA/UnkMqJEtDH9ZVUfoTWC/9dpoCW22SMsI AnYQ== 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=xodtG70ho0xQ+jx4nGOYZeCWL6O4ZVMTvPedyL4nOKg=; b=d1DRfztrc7YfNa0fU4LKIBGWGJ2OXOJqyYgh0Je3f1nB5pBPzTWfgsvi2y/84xhhNC pkdwq5/aBJXKBsl1qOWTJ1r2dts51+XqO2Bci9T1w4607z+ZpM/xQYbN7NOAEEAjN6zT q/xNGWRnfewBXJI9rwqIXlOUW1Zked6qNLnyZ8dOTbht8sKe0PHbiCqs9evDwmOQI5+u ilsQk4pDEPqH2HT2sUZThn6VkImBRtSHLv9o15wJXSiTXywGl+bG4ZBlIcO8Xsqhxvwl 74tRrqocuzMmufyM5HVSFVCRMMMog4IA9eZTa2J3w8A2eOW+5lSbQ7r4kCIuEdPqxHeV GIbQ== 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 h13si1820636otn.112.2020.03.11.17.43.10; Wed, 11 Mar 2020 17:43:23 -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 S1731535AbgCLAlW (ORCPT + 99 others); Wed, 11 Mar 2020 20:41:22 -0400 Received: from mga18.intel.com ([134.134.136.126]:51049 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731476AbgCLAlW (ORCPT ); Wed, 11 Mar 2020 20:41:22 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2020 17:41:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,542,1574150400"; d="scan'208";a="289557039" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 11 Mar 2020 17:41:19 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 49C6616D; Thu, 12 Mar 2020 02:41:19 +0200 (EET) Date: Thu, 12 Mar 2020 03:41:19 +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: <20200312004119.b7uew2jriwx2mks5@black.fi.intel.com> References: <20200311172440.6988-1-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200311172440.6988-1-vbabka@suse.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). -- Kirill A. Shutemov