Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3029728imu; Mon, 19 Nov 2018 09:34:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/VU/TOnrVNak6gD2T+qaQXEsBK+P7h4w7aphBwvEzrdww5CKC3+1Ii4b1OcQexJ27Xh1LTt X-Received: by 2002:a17:902:c01:: with SMTP id 1-v6mr3827844pls.15.1542648884425; Mon, 19 Nov 2018 09:34:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542648884; cv=none; d=google.com; s=arc-20160816; b=juGT+rHvvuSDJFkhPGYNNpYEFFs2S6YqrVPbwEryzN+7Ld5shnyWhICrJ+pXCK029v akVldFMSj3X9nivxT+uZcY1rzFL8NvtemL7kKDRCGHZLJ4Rvwgc9U3FI/1zmy/RvD/fb 9qpO+ngYQUxuFik6BVFL5/h3F4cJcvoQ290y4cYW8I45bl/FU9zXZRQsg5B4KNEmivPI Ea6cT4AM3fPeWRMVMk7AUVD6w75/uy21dHE7xmUXMCmUtnw65JEJ7lHabR4lXknfAk0L 7aOJWPpt8DmRYrR9RfeWtDhqDUT439d6vIP8dZvUWx6TBxwawIOpsRccY2UYRY7ned/V 08nA== 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:organization:from:references:cc:to:subject :dkim-signature; bh=X35vDiXCDTaVhviJNzlqUpuIU3mpIIcv4WII44DVcYw=; b=NCHiSh+/5kwiSqy7jHLuFOHtQv3cxk6NNuTL48Pn9PB03uvbbsO3k6GY5IAGWza6z0 +H+Cwyg56Gsw1c8K0lLq+h7d6CRc8KAWropns+NO9BLpX2dKYzHbKJe19Bpei6avvZY/ Evigf0xt6HtRrFVXaWSB978Ay7RJkk5qd8+higve5QNSXTw3J4EQdGHjfuOlMcXEWUIg pMFuMp4Yw3CQzVhEtU1WFDy9pAWxScr2rWrjVmrvC/xYFq/SKlYi5Gq1OcJtIMp4RFXK qt8Gg6V1cU1xYig0z5FUKa8zFYMd8qWB2heC2lrc7+xi5ppbJvDR+VFu9OuUR4aEGvZV 1BVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=nSBLsx6h; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d125si29102210pgc.418.2018.11.19.09.34.23; Mon, 19 Nov 2018 09:34:44 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=nSBLsx6h; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391003AbeKTD5r (ORCPT + 99 others); Mon, 19 Nov 2018 22:57:47 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:39950 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390965AbeKTD5q (ORCPT ); Mon, 19 Nov 2018 22:57:46 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAJHTWQR181103; Mon, 19 Nov 2018 17:32:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=X35vDiXCDTaVhviJNzlqUpuIU3mpIIcv4WII44DVcYw=; b=nSBLsx6hObnaDwNFuSYcxEuubnUCiLQ7ErlMIAgulgfRveb+PGHissoPmrXkStjVmvMp 3Dt6WsUhdzF4pXsag7RyeA7V6mViH82AFleat1LEu8wpOPSVIj0gRqU8py2NfJ/4fOxz 3p6dzsV0f3y13puMZwt6j57IGQVK34CJq1KOP+XJsYm+KP0QHsCAEyShnmW2Vd65bmP9 Z48s9Tyki24zTwS03GLaEa40Zc/zeCTHBayLaaEEhtNzalkCTM2SMg7ULfBbLyXtbBN4 /PclWyDIkUAvIYUj5NKQqamLuDwNm13aAe4LxJjPWLcyiGGZY37fUClr8EPcev1Q0P8x 4A== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2ntbmqfc24-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Nov 2018 17:32:55 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wAJHWrIo009595 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Nov 2018 17:32:54 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wAJHWqbH006186; Mon, 19 Nov 2018 17:32:52 GMT Received: from [10.152.35.100] (/10.152.35.100) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 19 Nov 2018 09:32:52 -0800 Subject: Re: [PATCH v3 03/10] sched/topology: Provide cfs_overload_cpus bitmap To: Valentin Schneider , 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: Steven Sistare Organization: Oracle Corporation Message-ID: <2efadddc-ebc0-1cdb-5580-4a9ab5610e61@oracle.com> Date: Mon, 19 Nov 2018 12:32:49 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9082 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811190160 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/9/2018 12:38 PM, Valentin Schneider wrote: > 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? My snippet needs rq which is currently referenced in cpu_attach_domain() but not in update_top_cache_domain(). I could just as easily do it in update_top_cache_domain(). Either way is fine with me. >> 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. OK, will add a comment. I like the macro because the code is cleaner if/when multiple sets are created. - Steve