Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1021230imu; Fri, 9 Nov 2018 09:39:27 -0800 (PST) X-Google-Smtp-Source: AJdET5dJl8ZrDXoF5mRCsh/7CwrWtolIP6OrlWKRpY3jJm1tqZkRopnets9qjRXTJwYMBqRibJJK X-Received: by 2002:a17:902:e101:: with SMTP id cc1-v6mr9940361plb.165.1541785167723; Fri, 09 Nov 2018 09:39:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541785167; cv=none; d=google.com; s=arc-20160816; b=tYVIqIjGo7QB73maD9+kuxSQCa8y9vkOcrDT11aItyePKhoUA+7KnenPD1pmT63TPP tw/jj4IKW4jRTcifRiib4ybkxdRq+LBpvVTFHtfW09oP+jLFKPUC0GWHxwHjKmqTNf9J V5ORTXlD34s8uq9KloKZB8Hg2NXiVRXJFP8IY24JiCpNTY01+qrOnH2GsqOJdg7Hf3Rh RkeCs5Gpx+wJe+vrXEolVS15oCs8sa0GbEfeSuH/qeTeoXkS+Mwsbf5UzqcLm4aaahCJ kYdudGuY7MQmQGBPEQ5543wZASQh0RYtz08WGKoEumVNv/qwCCe2jMqKRRuN6qDH2kxN Rk7w== 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=ysvEp+ISifPUR9HVIo0tm5bKvBskZBoIZ5zevVYnVEA=; b=C/Eeg7sqMfjepMTvE9Q0SLlicV1E22PuKyE2Lka7Dw95y1i/FJbURagoRwm7IOh8Or UX/R8j0ucccIkQLtkazNsRgbamJBlMTF7lm6LrpuB0y+oyWBffvTWCtbN49wP90XYijH IKwaqI78Z0tPujYKDm+LX09EiHicf5LpRSPTGv8NZoFC3Rmc8RcWPFu8lsjrG2k6Rzqo ZvOY5w2BEUPscliitfhHWBetewD6tm5xomZG3V4uV9iTsrAU7OZ4Voi6ZUP1sVrHqEXf /0f/3+38K+Am236uiAyF1ag8UyIdZqwRGrrPnVvkYddeqpzm1yy4io0vapA3VtaEtZ89 YV4g== 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 g189-v6si7487122pgc.204.2018.11.09.09.39.01; Fri, 09 Nov 2018 09:39:27 -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 S1728361AbeKJDUO (ORCPT + 99 others); Fri, 9 Nov 2018 22:20:14 -0500 Received: from foss.arm.com ([217.140.101.70]:35532 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728007AbeKJDUO (ORCPT ); Fri, 9 Nov 2018 22:20:14 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C33AEA78; Fri, 9 Nov 2018 09:38:38 -0800 (PST) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 67E353F718; Fri, 9 Nov 2018 09:38:36 -0800 (PST) Subject: Re: [PATCH v3 03/10] sched/topology: Provide cfs_overload_cpus bitmap To: Steve Sistare , mingo@redhat.com, peterz@infradead.org Cc: subhra.mazumdar@oracle.com, dhaval.giani@oracle.com, daniel.m.jordan@oracle.com, pavel.tatashin@microsoft.com, matt@codeblueprint.co.uk, umgwanakikbuti@gmail.com, riel@redhat.com, jbacik@fb.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, quentin.perret@arm.com, linux-kernel@vger.kernel.org References: <1541767840-93588-1-git-send-email-steven.sistare@oracle.com> <1541767840-93588-4-git-send-email-steven.sistare@oracle.com> From: Valentin Schneider Message-ID: Date: Fri, 9 Nov 2018 17:38:34 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1541767840-93588-4-git-send-email-steven.sistare@oracle.com> Content-Type: text/plain; charset=utf-8 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 Hi Steve, On 09/11/2018 12:50, Steve Sistare wrote: [...] > @@ -482,6 +484,10 @@ static void update_top_cache_domain(int cpu) > dirty_sched_domain_sysctl(cpu); > destroy_sched_domains(tmp); > > + sd = highest_flag_domain(cpu, SD_SHARE_PKG_RESOURCES); > + cfs_overload_cpus = (sd ? sd->shared->cfs_overload_cpus : NULL); > + rcu_assign_pointer(rq->cfs_overload_cpus, cfs_overload_cpus); > + Why not do this in update_top_cache_domain() where we also look for the highest SD_SHARE_PKG_RESOURCES and setup shortcut pointers? > update_top_cache_domain(cpu); > } > > @@ -1619,9 +1625,19 @@ static void __sdt_free(const struct cpumask *cpu_map) > } > } > > +#define ZALLOC_MASK(maskp, nelems, node) \ > + (!*(maskp) && !zalloc_sparsemask_node(maskp, nelems, \ > + SPARSEMASK_DENSITY_DEFAULT, \ > + GFP_KERNEL, node)) \ > + > static int sd_llc_alloc(struct sched_domain *sd) > { > - /* Allocate sd->shared data here. Empty for now. */ > + struct sched_domain_shared *sds = sd->shared; > + struct cpumask *span = sched_domain_span(sd); > + int nid = cpu_to_node(cpumask_first(span)); > + > + if (ZALLOC_MASK(&sds->cfs_overload_cpus, nr_cpu_ids, nid)) Mmm so this is called once on every CPU, but the !*(maskp) check in the macro makes it so there is only one allocation per sd_llc_shared. I wouldn't mind having that called out in a comment, or having the pointer check done explicitly outside of the macro. [...]