Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp378311pxk; Thu, 3 Sep 2020 02:01:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQliJZreFBO2NCy7xC07nWyiELc9LTojHFisjGx9YJysuwagvJR4ksG3pVuGiTHm0YLioh X-Received: by 2002:a17:906:24d6:: with SMTP id f22mr1028606ejb.85.1599123709068; Thu, 03 Sep 2020 02:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599123709; cv=none; d=google.com; s=arc-20160816; b=tRcnvVFvN2ZZwI/yu02HQD0E+1uNPAmWm/HAwguHHuzUkra9ljs8e5dFLQbcOl6vo4 RBrM62yu7DWcTt0AZ9wjLrM3orhLau1ZfrPYHnk9E0Qx0COSrNSTjtJOrxWlCzFkktKu xnInEry6CXHk4ovlMonikLcCeG9x2Z5+NawpvVZo3VyScoD4bxIyERs3K3NQsipXr+gU i7RP1VgDXU2EWJ71G2svk/rQS28waAmeyoRJTAskm5lJkxetM8ZhY+qPQTWLdfHED2Z/ +7mFi2/Bs2z9itrKELq6RKFYPAVY1lu+cV2miMpxZKzYTsLcknLG4zcq5rD2rf9b94w6 1qDw== 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:references:cc:to:subject; bh=s8RwYFwo7wVjnNSy/rzEUbD818W9lvUn0SuLrGU6Rr4=; b=QcNNgDxZRgjSel/QkYp21p0/985sA3oA4WJ/llrV1XwwsXK+EC6+0V19deuuA9GvLK GEaTEyKYc1P/Fxm7XPP/QJaTpw/ZXOyTXONXtRwNHtU1gkpMX2cwBXbQl5CA5h3a65OS 8X1DJhs9zeiUNkInncfPJ0LmJAje36/6GC3YwEAi6iAfr0xcB8Xma+/PPcXZjMpBD57t NUzl2SQbVVfc9usP7GPNji0IzAIih7HAltayj6ccvqKe5SSrm8GyKku1FGuxypblVUW0 dPxmAw6QaxuKWiG3aFycMcwqgOhpZ5OVElR44a0bY2KW8bcmCDaoh5hc9u7ELeulqu6x +nyQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qh9si1405882ejb.613.2020.09.03.02.01.26; Thu, 03 Sep 2020 02:01:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726726AbgICJA3 (ORCPT + 99 others); Thu, 3 Sep 2020 05:00:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:36674 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbgICJA2 (ORCPT ); Thu, 3 Sep 2020 05:00:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 70374AC4C; Thu, 3 Sep 2020 09:00:27 +0000 (UTC) Subject: Re: [PATCH v4 1/4] mm/pageblock: mitigation cmpxchg false sharing in pageblock flags To: Alex Shi , Mel Gorman Cc: Anshuman Khandual , David Hildenbrand , Matthew Wilcox , Alexander Duyck , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1599116482-7410-1-git-send-email-alex.shi@linux.alibaba.com> <20200903072447.GB3179@techsingularity.net> <8275cc70-fd35-25c8-36d4-525a10f05e41@linux.alibaba.com> <7813624a-d8af-f09f-d8c3-0d2a01fe5dd3@linux.alibaba.com> From: Vlastimil Babka Message-ID: Date: Thu, 3 Sep 2020 11:00:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <7813624a-d8af-f09f-d8c3-0d2a01fe5dd3@linux.alibaba.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/3/20 10:40 AM, Alex Shi wrote: > > > 在 2020/9/3 下午4:32, Alex Shi 写道: >>> >> I have run thpscale with 'always' defrag setting of THP. The Amean stddev is much >> larger than a very little average run time reducing. >> >> But the left patch 4 could show the cmpxchg retry reduce from thousands to hundreds >> or less. >> >> Subject: [PATCH v4 4/4] add cmpxchg tracing > > > It's a typical result with the patchset: > > Performance counter stats for './run-mmtests.sh -c configs/config-workload-thpscale pageblock-c': > > 9,564 compaction:mm_compaction_isolate_migratepages > 6,430 compaction:mm_compaction_isolate_freepages > 5,287 compaction:mm_compaction_migratepages > 45,299 compaction:mm_compaction_begin > 45,299 compaction:mm_compaction_end > 30,557 compaction:mm_compaction_try_to_compact_pages > 95,540 compaction:mm_compaction_finished > 149,379 compaction:mm_compaction_suitable > 0 compaction:mm_compaction_deferred > 0 compaction:mm_compaction_defer_compaction > 3,949 compaction:mm_compaction_defer_reset > 0 compaction:mm_compaction_kcompactd_sleep > 0 compaction:mm_compaction_wakeup_kcompactd > 0 compaction:mm_compaction_kcompactd_wake > 68 pageblock:hit_cmpxchg > > 113.570974583 seconds time elapsed > > 14.664451000 seconds user > 96.847116000 seconds sys > > It's 5.9-rc2 base kernel result: > > Performance counter stats for './run-mmtests.sh -c configs/config-workload-thpscale rc2-e': > > 15,920 compaction:mm_compaction_isolate_migratepages > 20,523 compaction:mm_compaction_isolate_freepages > 9,752 compaction:mm_compaction_migratepages > 27,773 compaction:mm_compaction_begin > 27,773 compaction:mm_compaction_end > 16,391 compaction:mm_compaction_try_to_compact_pages > 62,809 compaction:mm_compaction_finished > 69,821 compaction:mm_compaction_suitable > 0 compaction:mm_compaction_deferred > 0 compaction:mm_compaction_defer_compaction > 7,875 compaction:mm_compaction_defer_reset > 0 compaction:mm_compaction_kcompactd_sleep > 0 compaction:mm_compaction_wakeup_kcompactd > 0 compaction:mm_compaction_kcompactd_wake > 1,208 pageblock:hit_cmpxchg > > 116.440414591 seconds time elapsed > > 15.326913000 seconds user > 103.752758000 seconds sys The runs wildly differ in many of other stats, so I'm not sure they are really comparable. I guess you could show the fraction of hit_cmpxchg to all cmpxchg. But there's also danger of tracepoints widening the race window. In the end what matters is how these 1208 retries contribute to runtime. I doubt they could be really visible in a 100+ seconds run though.