Received: by 10.223.176.46 with SMTP id f43csp1147619wra; Wed, 24 Jan 2018 11:24:37 -0800 (PST) X-Google-Smtp-Source: AH8x224MwJgM6q5gfweH46+4oGipwyRzAN8K5Yj/u0Za93CAuZHxeLLdIvzcOJfZnTCmhkcaq8tp X-Received: by 2002:a17:902:a610:: with SMTP id u16-v6mr8936674plq.401.1516821877793; Wed, 24 Jan 2018 11:24:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516821877; cv=none; d=google.com; s=arc-20160816; b=YWCY/BnXkb9WgMjRBJ5tw2GgdqQ8FHl0ZGZk7IlPWiCTrmTV9PAaIlebAZ5ZRYrmIX oUN+33W/ZIl8dLMTE9m0z7XluXV2GoKjDruDQiiGHqsjtTfMRJ4nEXTrlwEjRiat+DBj e7U7dlmfXKlTe1KgiaHdEs+T2gRiwgSEHGDpF94TlhFgyzCqHMkfLKstXNk1n2tc+4zi F6Oj83fbcoxsgChTzPlVAZZBLxcProusYzTyk2t3W2JKkCxP25Fz+NGLOfJWF9G9Y/PV z1jNJ7BOiEO9aQPJ9uA/j4qera/PpopKCHHh2vcKOZa6Hjg17wRsxfjdiCrmMc6HKz7X IDRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:arc-authentication-results; bh=uQBB8UpAkhPtyGa9m4HpkqTbmXALRW2wxYPoz9xYKbk=; b=Wjld6YmcpiLq7EIo50d1+h73qBclTeOXUqS1g1wtkcWHqzBPSZqzlHtdEgaQ/3vRXX cPTQK+neyn6khpsEGlfJxZZV3dgcCaU3jRjdFAjfxyPwfpWYKH688Bym3LVQAAzlhLcd V8b+nQt/sITsupvn8UrdKv4UDKPjwpTpgHzvnsPYs856bjAQvA3f5j5OrREANJNeCwSc CQHP8JZeUYa0GNM+GUbgiFleV76VYFcNgs+1VSGTZaRsTBbVa2oo4MlzlTFztSkmhDFY WkOMby3+sGE8ksGmAwTGWBmDQ/Ly6EYOW4lwmGpcfgEM9sGpfcAOxle2MeZSQXg9Ffda MnVw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5-v6si623213plg.729.2018.01.24.11.24.24; Wed, 24 Jan 2018 11:24:37 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752544AbeAXTXz (ORCPT + 99 others); Wed, 24 Jan 2018 14:23:55 -0500 Received: from mga04.intel.com ([192.55.52.120]:2431 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483AbeAXTXv (ORCPT ); Wed, 24 Jan 2018 14:23:51 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2018 11:23:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,409,1511856000"; d="scan'208";a="195995833" Received: from ray.jf.intel.com (HELO [10.7.201.133]) ([10.7.201.133]) by orsmga005.jf.intel.com with ESMTP; 24 Jan 2018 11:23:50 -0800 Subject: Re: [PATCH 2/2] free_pcppages_bulk: prefetch buddy while not holding lock To: Mel Gorman References: <20180124023050.20097-1-aaron.lu@intel.com> <20180124023050.20097-2-aaron.lu@intel.com> <20180124164344.lca63gjn7mefuiac@techsingularity.net> <148a42d8-8306-2f2f-7f7c-86bc118f8ccd@intel.com> <20180124181921.vnivr32q72ey7p5i@techsingularity.net> Cc: Aaron Lu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Huang Ying , Kemi Wang , Tim Chen , Andi Kleen , Michal Hocko , Vlastimil Babka From: Dave Hansen Message-ID: <525a20be-dea9-ed54-ca8e-8c4bc5e8a04f@intel.com> Date: Wed, 24 Jan 2018 11:23:49 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180124181921.vnivr32q72ey7p5i@techsingularity.net> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/24/2018 10:19 AM, Mel Gorman wrote: >> IOW, I don't think this has the same downsides normally associated with >> prefetch() since the data is always used. > That doesn't side-step the calculations are done twice in the > free_pcppages_bulk path and there is no guarantee that one prefetch > in the list of pages being freed will not evict a previous prefetch > due to collisions. Fair enough. The description here could probably use some touchups to explicitly spell out the downsides. I do agree with you that there is no guarantee that this will be resident in the cache before use. In fact, it might be entertaining to see if we can show the extra conflicts in the L1 given from this change given a large enough PCP batch size. But, this isn't just about the L1. If the results of the prefetch() stay in *ANY* cache, then the memory bandwidth impact of this change is still zero. You'll have a lot harder time arguing that we're likely to see L2/L3 evictions in this path for our typical PCP batch sizes. Do you want to see some analysis for less-frequent PCP frees? We could pretty easily instrument the latency doing normal-ish things to see if we can measure a benefit from this rather than a tight-loop micro.