Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1008753iob; Fri, 13 May 2022 19:27:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzF8aqDMvgueQwGVQhq0w+It/rkCrV1+WZ4JTGFACl7KH8aFMMCxFaHzGuGpvQDYaa/AF0 X-Received: by 2002:adf:fd0b:0:b0:20a:ea57:6dab with SMTP id e11-20020adffd0b000000b0020aea576dabmr6005182wrr.175.1652495222664; Fri, 13 May 2022 19:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652495222; cv=none; d=google.com; s=arc-20160816; b=lYbZhHlC/WdOTlhwLUUSVsxk0HDdY7CsL/qMQ5YEKkOMwmbS+qSvMGhfeFz/fuEK6+ jMU6OUPZ8vXkU+hL1trnfOGyJ7Ff+bt4reo8e1hwFjnJwUcPiax2zGeseEGMV7QcyjSx tpiCZIdwKIMThcb/t5fTAfSc6ECYcrgluruXrDshyOMm9ZUIgGsoTLrG+moTsCsZ64my QJWJwq/z2Ndlu5h1IFQyVmRleg4Vk3bQQlpS3wtZ59qteslra6xjv07y+NoEzhBwZfhO PNwwWGsj4ch7Ph76m9eiudeE1iFG4tqUoiMQMm/RnqSoQqro/Z2WfetBOHrnlLdH7bp2 dlWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KAHLDr1Q/w2FNHreQXjS9VMKVRbPGfl4DI6ipsPBBHs=; b=F9oN1aW1mVkK0S+QJ4gEORuuT6uMKSyOlAGRmt3i3pPjG3XbB/l5/Z9UB+A9kOMN37 UoE+j+rQpNwyYs2C+7FpcDurNRqNSarEcoCGKKoPRrrKdBY0VYh4LzPhLde/kA2NT2PM HISVnPF3wxBYdgw7P8u2QH1qGACHtR5ve6v8R2rNVkaf5Rfwyx8XZM6Gm9PnrV7tOyIR 186za2BxzgWKAbQ2Rn8dPUP8TGyjQpehpf8tv5foISoWhO7hcTg85ka7LoEwAzJeevcZ GkeNOqoICEk92tP1h8UWejO33cgQdM7rM0dovHF6Z/2wiXUdju30CFfBpZDDH3SIJ4lI 6azg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Rc5soRIu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o3-20020a05600002c300b0020c86d4efe2si5308961wry.341.2022.05.13.19.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:27:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Rc5soRIu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8BF124D0EC2; Fri, 13 May 2022 17:41:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377397AbiEMGhx (ORCPT + 99 others); Fri, 13 May 2022 02:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377387AbiEMGhv (ORCPT ); Fri, 13 May 2022 02:37:51 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C79969B47 for ; Thu, 12 May 2022 23:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KAHLDr1Q/w2FNHreQXjS9VMKVRbPGfl4DI6ipsPBBHs=; b=Rc5soRIu94PFCK89NHxJNNhGVL 3dkojjFFcK/XsWC9AQKDs6hQyI9RSE9PDRnqa/kdbqP4ccn+gYmrItosEivuos5I2JhI+aqVXUnIk mU/F14bk9JuwZq8I2G1nFvE3aa5NL0oBZSwl38vEErkjXIHTxXdaXkS5demTfTdznWeHktJ/6jYQE 4a0TIInknMX0zQBmWhBrr+AhDGe3Xsd3DUp2XC+IL9Ik7x3waVoIyFbftdNgE8yfgBBqdp3X1beOs mo1f7UTQIvE95WwFaiaht893B/ppVxFrIMYs5eusYFfky+kYAQ+o6NLBlD6bO1kOuLg/yrrFSRm0i /4xN5KnA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1npOvc-00774O-60; Fri, 13 May 2022 06:37:32 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 9FBAA980F9A; Fri, 13 May 2022 08:37:29 +0200 (CEST) Date: Fri, 13 May 2022 08:37:29 +0200 From: Peter Zijlstra To: Tianchen Ding Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] sched: Queue task on wakelist in the same llc if the wakee cpu is idle Message-ID: <20220513063729.GF76023@worktop.programming.kicks-ass.net> References: <20220513062427.2375743-1-dtcccc@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220513062427.2375743-1-dtcccc@linux.alibaba.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 13, 2022 at 02:24:27PM +0800, Tianchen Ding wrote: > We notice the commit 518cd6234178 ("sched: Only queue remote wakeups > when crossing cache boundaries") disabled queuing tasks on wakelist when > the cpus share llc. This is because, at that time, the scheduler must > send IPIs to do ttwu_queue_wakelist. No; this was because of cache bouncing. > Nowadays, ttwu_queue_wakelist also > supports TIF_POLLING, so this is not a problem now when the wakee cpu is > in idle polling. > > Benefits: > Queuing the task on idle cpu can help improving performance on waker cpu > and utilization on wakee cpu, and further improve locality because > the wakee cpu can handle its own rq. This patch helps improving rt on > our real java workloads where wakeup happens frequently. > > Does this patch bring IPI flooding? > For archs with TIF_POLLING_NRFLAG (e.g., x86), there will be no > difference if the wakee cpu is idle polling. If the wakee cpu is idle > but not polling, the later check_preempt_curr() will send IPI too. > > For archs without TIF_POLLING_NRFLAG (e.g., arm64), the IPI is > unavoidable, since the later check_preempt_curr() will send IPI when > wakee cpu is idle. > > Benchmark: > running schbench -m 2 -t 8 on 8269CY: > > without patch: > Latency percentiles (usec) > 50.0000th: 10 > 75.0000th: 14 > 90.0000th: 16 > 95.0000th: 16 > *99.0000th: 17 > 99.5000th: 20 > 99.9000th: 23 > min=0, max=28 > > with patch: > Latency percentiles (usec) > 50.0000th: 6 > 75.0000th: 8 > 90.0000th: 9 > 95.0000th: 9 > *99.0000th: 10 > 99.5000th: 10 > 99.9000th: 14 > min=0, max=16 > > We've also tested unixbench and see about 10% improvement on Pipe-based > Context Switching, and no performance regression on other test cases. > > For arm64, we've tested schbench and unixbench on Kunpeng920, the > results show that, What is a kunpeng and how does it's topology look? > the improvement is not as obvious as on x86, and > there's no performance regression. x86 is wide and varied; what x86 did you test?