Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp263040rdg; Thu, 12 Oct 2023 05:13:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJBR690e+ux3aONMQzy9Cf8tAtzI7MFOwSePuV6vE9FwzJs9vim3CyE6qCOsvlx5Z3PvYR X-Received: by 2002:a05:6a00:190d:b0:68f:dfda:1814 with SMTP id y13-20020a056a00190d00b0068fdfda1814mr26481378pfi.18.1697112820198; Thu, 12 Oct 2023 05:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697112820; cv=none; d=google.com; s=arc-20160816; b=xQyL9Yi7n2SIphYWMLiGGmeV+NkrxqxFVrl48gXZW6uJE5nw/keowiYQ4yr5FusKWA INkj0jtpHeU3+w2cE9UUQqg0tf07r2P6AfPYcRCdXyIPFWeg8F+4vOzvyrD8Ze1AZnnO bIOPr58QFr1wm3UexDqZiYe5PL6/chfjShA1HPA2HABh0XpMomtLeWEvoUUVrM5M4o5J 6M2qp1S5/j/jq60imFZB+BE3SvhyiC0+HmucTRc/XGMI2SAtJwm7AKmX9l13zt6I3bTO 5gL9pbxqzO4TW1N9233HmVq0TmepMyhMlRqAxnM29Fsh9AV0k7Zrt6TgfrDHrixykK6Y 0cFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=FDSWCRwXqsnp5hycKErcp9tddRy7oS50ZF4M12lFBXA=; fh=C7HG5V2qJgDCUtG5iNgf38DqFeZ6EVwWyydLK3IqHwc=; b=O5tKd+aAdp7Egs0/EOzzJs/qiybm/fSs1JS86m1zm+HSwO2OS27D3MYtthdy9vYJnS TdZzBZeg56lZX6PHYi4JL2nBOxm1+o7AREq1+57uqUaLapL1c0bWBZj3R5pOfaATJoY6 dwwVUhC1vO3Dg/GAydNU0zo10O2uLC6V9oRrk4RBuoQtffxEEGSCcrfAA8ZoRsu0BjrA qIIG8EINkU2Mpxq5uHd72444uuX/iAGlOlfoC+3Vr0esSpVjx7qiB6welSnV1JTZEO6V 5HaRghh4F50nHtmEv8eiLIsyv88Bcn+UKFk16ozH67Kdw8dJtyBtjb1BJSYgstZ7GpN5 XLTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XlY83SVY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id y3-20020a634b03000000b00585a454179fsi2164183pga.162.2023.10.12.05.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 05:13:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XlY83SVY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D436981A7D39; Thu, 12 Oct 2023 05:13:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378413AbjJLMNa (ORCPT + 99 others); Thu, 12 Oct 2023 08:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347216AbjJLMN2 (ORCPT ); Thu, 12 Oct 2023 08:13:28 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58F52C9 for ; Thu, 12 Oct 2023 05:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697112807; x=1728648807; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=w8yQt9oo86/nZjDSgadz2LDv3J3dqgnu9r6s3Un8WxE=; b=XlY83SVYM4hEj0iAialMTH+aijTKggwXLZFEYpiH/3OIuKPRYfbATtr8 O+Jlo2mr7hVMYjbiOY8CPGcv5dq4m1e3cD40wpv8+mlQauw/SYhA5nmzR ggiK8oC36fS9yGC8CBKXkkLW5wUkKuUBzP1/57HOQhnhlSHBCfrVgoCvf 0p6PWUOR3IBqBROa9OCDYAbcBspnPQzBM9VZJSrKDkPZf4aF7Dwch7Xdc iGaAum7zvCMbOomgOISYDQsJhFr2r+8OssSjodmf1tdHBbQy8iREWNZGh RxX3XAOJpuZFmJAcV8HqVLDnhZUPnyruzJQRxyLI6ppSTPkGUe1d+JrrV Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="471162914" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="471162914" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 05:13:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="789374334" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="789374334" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 05:13:23 -0700 From: "Huang, Ying" To: Mel Gorman Cc: , , Arjan Van De Ven , Andrew Morton , Vlastimil Babka , David Hildenbrand , Johannes Weiner , Dave Hansen , Michal Hocko , Pavel Tatashin , Matthew Wilcox , "Christoph Lameter" Subject: Re: [PATCH 03/10] mm, pcp: reduce lock contention for draining high-order pages References: <20230920061856.257597-1-ying.huang@intel.com> <20230920061856.257597-4-ying.huang@intel.com> <20231011124900.sp22hoxoitrslbia@techsingularity.net> Date: Thu, 12 Oct 2023 20:11:19 +0800 In-Reply-To: <20231011124900.sp22hoxoitrslbia@techsingularity.net> (Mel Gorman's message of "Wed, 11 Oct 2023 13:49:00 +0100") Message-ID: <87cyxkf3bs.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 12 Oct 2023 05:13:37 -0700 (PDT) Mel Gorman writes: > On Wed, Sep 20, 2023 at 02:18:49PM +0800, Huang Ying wrote: >> In commit f26b3fa04611 ("mm/page_alloc: limit number of high-order >> pages on PCP during bulk free"), the PCP (Per-CPU Pageset) will be >> drained when PCP is mostly used for high-order pages freeing to >> improve the cache-hot pages reusing between page allocating and >> freeing CPUs. >> >> On system with small per-CPU data cache, pages shouldn't be cached >> before draining to guarantee cache-hot. But on a system with large >> per-CPU data cache, more pages can be cached before draining to reduce >> zone lock contention. >> >> So, in this patch, instead of draining without any caching, "batch" >> pages will be cached in PCP before draining if the per-CPU data cache >> size is more than "4 * batch". >> >> On a 2-socket Intel server with 128 logical CPU, with the patch, the >> network bandwidth of the UNIX (AF_UNIX) test case of lmbench test >> suite with 16-pair processes increase 72.2%. The cycles% of the >> spinlock contention (mostly for zone lock) decreases from 45.8% to >> 21.2%. The number of PCP draining for high order pages >> freeing (free_high) decreases 89.8%. The cache miss rate keeps 0.3%. >> >> Signed-off-by: "Huang, Ying" > > Acked-by: Mel Gorman > > However, the flag should also have been documented to make it clear that > it preserves some pages on the PCP if the cache is large enough. Sure. Will do this. > Similar > to the previous patch, it would have been easier to reason about in the > general case if the decision had only been based on the LLC without > having to worry if any intermediate layer has a meaningful impact that > varies across CPU implementations. Sure. Will do this. -- Best Regards, Huang, Ying