Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1278490imm; Wed, 23 May 2018 13:19:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp9k4wkRuvcwaHcIkFX7SPJpgZRu/kdKuZMpcR9Ha4ObLK01Mw+jC4NGFz9a0xPz+LbvKt8 X-Received: by 2002:a65:48c9:: with SMTP id o9-v6mr3507356pgs.106.1527106781342; Wed, 23 May 2018 13:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527106781; cv=none; d=google.com; s=arc-20160816; b=Q2OFmhf3wYzv2pgIp2FgjWgZ/nDR32FutJgJk5lvQRM0Cw0MJ4vfkvNtuvEYA1WT2w UObIvGFvCzgi0/NmHXltRxyWMR4wz+NNRAJxI0AfQlBfoh+B51ST9Bui96NoI4xfvAF2 ZfS+18s0vXNzIvTSw0GMZq4C+Fp2zCafItOego4laT2HgUcHiFHu6ic8CIxn+sLKejFX 3JAocDvQaFsgJvirR1rv7M5pnVWepRgoFnepjdDcmhgtFrZA0WD+5JFvZJOm+no7o4gR ESigBVOfLNBgOshVMRyJCgSPeodWXA+vUmN6zCVAPXyrluN3mhzhxvkufAs34AmyO+CA pMdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=eU3iBpTt96APUjQzqwo3ZjeuHMwGex+oChUXJcqNXOA=; b=mOkMy8DEZ4O7zdzvWICi7FR6EhzO3cm66+vGECVonsFc0hPA45W1tevdDRPnD9PYiy dMyR/dv2l/cuXWMhoj4uL8OhAWQA70rCy9wOtDK2wyXyeDKYMs5HGkER7+S/Tg+UTUnz RwMY9Cl+PlM5Ryh6GLcSIMfN/3v+mQqbWi81oQp34SSsbmTG1fcfp4PzIWFIMukdfW4d oGSoiSClvPIAx3vprO6DD8or7iO27Te+O4PfLzAgx8NN1lSYixg1bO2r3Df8PvlFNXh6 SRISr5nZWVxcUp0ei3pORTWTbgyf184dVL32TIhW62y5PoUCX7IdKuVqGxk/TcaHvYYZ vi1A== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a81-v6si19920367pfg.200.2018.05.23.13.19.26; Wed, 23 May 2018 13:19:41 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934890AbeEWUTA (ORCPT + 99 others); Wed, 23 May 2018 16:19:00 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42094 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934873AbeEWUS5 (ORCPT ); Wed, 23 May 2018 16:18:57 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4569F4023112; Wed, 23 May 2018 20:18:56 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-182.bos.redhat.com [10.18.17.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 96E1D2166BB2; Wed, 23 May 2018 20:18:53 +0000 (UTC) Subject: Re: [PATCH v8 4/6] cpuset: Make generate_sched_domains() recognize isolated_cpus To: Patrick Bellasi Cc: Tejun Heo , Li Zefan , Johannes Weiner , Peter Zijlstra , Ingo Molnar , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kernel-team@fb.com, pjt@google.com, luto@amacapital.net, Mike Galbraith , torvalds@linux-foundation.org, Roman Gushchin , Juri Lelli References: <1526590545-3350-1-git-send-email-longman@redhat.com> <1526590545-3350-5-git-send-email-longman@redhat.com> <20180523173453.GY30654@e110439-lin> From: Waiman Long Organization: Red Hat Message-ID: Date: Wed, 23 May 2018 16:18:53 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180523173453.GY30654@e110439-lin> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 23 May 2018 20:18:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 23 May 2018 20:18:56 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/23/2018 01:34 PM, Patrick Bellasi wrote: > Hi Waiman, > > On 17-May 16:55, Waiman Long wrote: > > [...] > >> @@ -672,13 +672,14 @@ static int generate_sched_domains(cpumask_var_t **domains, >> int ndoms = 0; /* number of sched domains in result */ >> int nslot; /* next empty doms[] struct cpumask slot */ >> struct cgroup_subsys_state *pos_css; >> + bool root_load_balance = is_sched_load_balance(&top_cpuset); >> >> doms = NULL; >> dattr = NULL; >> csa = NULL; >> >> /* Special case for the 99% of systems with one, full, sched domain */ >> - if (is_sched_load_balance(&top_cpuset)) { >> + if (root_load_balance && !top_cpuset.isolation_count) { > Perhaps I'm missing something but, it seems to me that, when the two > conditions above are true, then we are going to destroy and rebuild > the exact same scheduling domains. > > IOW, on 99% of systems where: > > is_sched_load_balance(&top_cpuset) > top_cpuset.isolation_count = 0 > > since boot time and forever, then every time we update a value for > cpuset.cpus we keep rebuilding the same SDs. > > It's not strictly related to this patch, the same already happens in > mainline based just on the first condition, but since you are extending > that optimization, perhaps you can tell me where I'm possibly wrong or > which cases I'm not considering. > > I'm interested mainly because on Android systems those conditions > are always true and we see SDs rebuilds every time we write > something in cpuset.cpus, which ultimately accounts for almost all the > 6-7[ms] time required for the write to return, depending on the CPU > frequency. > > Cheers Patrick > Yes, that is true. I will look into how to further optimize this. Thanks for the suggestion. -Longman