Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp998128imu; Fri, 7 Dec 2018 12:21:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/WGEFbJQ6Z8QTyKALHhfXhc6ezch6VW5OfKgbgrFtpfn5QExeukPfqGK8CYxg5SwipqygGg X-Received: by 2002:a62:938f:: with SMTP id r15mr3586222pfk.27.1544214082031; Fri, 07 Dec 2018 12:21:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544214082; cv=none; d=google.com; s=arc-20160816; b=RyjWh6JnOE1XZ76HjbNylLLRMWtMwv6sU3hF+t+5BH/yyEw7Q56uBTbhv7lXPtV18M UMtCHbaA879mKTGI+Y3jyC6Zl8P/EESFil8QeqDqWht/bpRd4DKpAqqDS3RGZVgncrV2 SCc5P2D7SOI9vNmkhkHdaMx9wEZFt8x2DVeasNooz3eXqTmOI5h1Zi12oSC9KVhITDSP OJg9PNLslCY8afWPhLUkSk1KLmgvQXoBAxxfWFlujxoZZAi1UOMOI6OU+mwRFcYgxebe NxAMocq1JTav/XL9H5RToPQ0Aiw+MGV1GX+oMJWa6t3kjP3J8QoRxjc3pHxzSu+sRrgL xo/w== 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=rOdu7iolp80m384ntlWjNoIM/dT3mdKkU3rHnny3rtM=; b=cEd7q/9g8PwmUzTByDm4jwPwRefyTEDjREm3Yks+oCj6QxcrHJazWIUBoSKZu6mwKv t3FCqTmevQVeYuqZHFb3yC7wt3cRgEXXGw5+sKF8U4Xh/ohifP/W/byP1yu7MAJTN5Wm jlcFnuG/Z4ijm5UsTraELNun6XsJGe5DigFSpf+FOPtLDzUrhVVTdTw4QxA12JRC/R50 KXCpSNPEURFsPrt/6seXHJbKo05MJEJOOiGTXzIKmpcQ65e8Ha6zeSkEc0dpE258B4Fl kzR4J3mMkX7b/o5vvvP27JFncpKi5I6YYIPX4kzjISg+iX2hLRPxNy1bG7GzdvGpj3bA 9c5g== 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 y1si3530828pgy.174.2018.12.07.12.21.05; Fri, 07 Dec 2018 12:21:21 -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 S1726112AbeLGUU3 (ORCPT + 99 others); Fri, 7 Dec 2018 15:20:29 -0500 Received: from foss.arm.com ([217.140.101.70]:53712 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbeLGUU3 (ORCPT ); Fri, 7 Dec 2018 15:20:29 -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 C6B1C15AB; Fri, 7 Dec 2018 12:20:28 -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 63A923F614; Fri, 7 Dec 2018 12:20:26 -0800 (PST) Subject: Re: [PATCH v4 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: <1544131696-2888-1-git-send-email-steven.sistare@oracle.com> <1544131696-2888-4-git-send-email-steven.sistare@oracle.com> From: Valentin Schneider Message-ID: <9253783d-d53f-9587-61eb-2505bca5fc0c@arm.com> Date: Fri, 7 Dec 2018 20:20:24 +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: <1544131696-2888-4-git-send-email-steven.sistare@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB 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 06/12/2018 21:28, Steve Sistare wrote: [...] > @@ -1621,7 +1626,22 @@ static void __sdt_free(const struct cpumask *cpu_map) > > 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)); > + int flags = __GFP_ZERO | GFP_KERNEL; > + struct sparsemask *mask; > + > + /* > + * Allocate the bitmap if not already allocated. This is called for > + * every CPU in the LLC but only allocates once per sd_llc_shared. > + */ > + if (!sds->cfs_overload_cpus) { > + mask = sparsemask_alloc_node(nr_cpu_ids, 3, flags, nid); ^^^^^^^^^^ ^^^ (1) (2) (1): Is this necessary? Wouldn't cpumask_weight(span) suffice? (2): Could this get a name somewhere? In v3 this was SPARSEMASK_DENSITY_DEFAULT, I think it'd make sense to have it in sched/sparsemask.c > + if (!mask) > + return 1; > + sds->cfs_overload_cpus = mask; > + } > > return 0; > } > @@ -1633,7 +1653,8 @@ static void sd_llc_free(struct sched_domain *sd) > if (!sds) > return; > > - /* Free data here. Empty for now. */ > + sparsemask_free(sds->cfs_overload_cpus); > + sds->cfs_overload_cpus = NULL; > } > > static int sd_llc_alloc_all(const struct cpumask *cpu_map, struct s_data *d) >