Received: by 10.223.164.221 with SMTP id h29csp4009610wrb; Tue, 31 Oct 2017 08:17:13 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SKhbwimuGOOxIgSOCNqg9BzHIpqyZTaZcTSd8jpgOoWH4zQEOzwGPLZ274TJhWcqHJA5hv X-Received: by 10.159.244.14 with SMTP id x14mr2110762plr.75.1509463033017; Tue, 31 Oct 2017 08:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509463032; cv=none; d=google.com; s=arc-20160816; b=UF6pkdjGgFzM7Pi2p4Zea8CTclliydAjhz0ty7xCEJ6fWYCKkV9mMag5mku/o6mfCi WBXuSYODtNE3DmFrN0H4ESg3G29scSIBuNpeW/gNaJJIQj9EPF8m5CFYUqc4Q1cZ/qjq a+sPrUDI6ci3TBA+JunY3OdQJPO/n3EIxcdKRqEoLZgxjGBie85wbiU5Pex/sAZ32ZB2 Ui3VdP98sUexRYtlx8jeOfgKoueg5sG3F2oP9JoL/Bst00J2AYOiO+pPixlLPkmEAUEi L8R/+uaIXVEwJrjfnb/WFRS9cfkRJD1Z+seIdKIOBGiXgfia+TDOLir26ruXRIotSntv RLPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=BBUQRw/k1s/QrZWQZ82eT0tEfHmPOF1YxgCgzGG3eFU=; b=USeR1g0dQZ4hxmZ+MbphF6mz3li9z/4PX40+JAqmaS4k/gckqDyVJ4rQ5DyyZzeBTL FXXGw9BZfQSiXsojJcNwADreXytPCxMFxnVaVEPYPXcrZn7jYBs7iUnTqJvG4jotxDy4 BnSigRTnQ7Db5aeBoBoYonzBPJOr0SkMYJOXwecN+1xZIUTOHiGzpT0mDAHWTF6I9P5v uvWOpwKXc9lRb+qv69zvb+boZ/xcoCMy8eD9lCbXlG7EC7yy59bHDx5i91ff+uHAS/Pq 5rlAAgE6P0I+VUek4B7BbZlMjI+foSjQ1fUihHn9KsxJmc5WEo9mpDLGoFwOT3SXI7sG YsNw== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g127si1732649pgc.553.2017.10.31.08.16.59; Tue, 31 Oct 2017 08:17:12 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753506AbdJaPPF (ORCPT + 99 others); Tue, 31 Oct 2017 11:15:05 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48652 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753306AbdJaPPC (ORCPT ); Tue, 31 Oct 2017 11:15:02 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9VFDFb6066238 for ; Tue, 31 Oct 2017 11:15:02 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dxuhtgcwp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 31 Oct 2017 11:15:01 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Oct 2017 15:14:59 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 31 Oct 2017 15:14:56 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9VFEtaX23330912; Tue, 31 Oct 2017 15:14:55 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 62EF0A4059; Tue, 31 Oct 2017 15:10:03 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05BC7A404D; Tue, 31 Oct 2017 15:10:03 +0000 (GMT) Received: from localhost (unknown [9.77.120.126]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 31 Oct 2017 15:10:02 +0000 (GMT) Date: Tue, 31 Oct 2017 20:44:53 +0530 From: "Naveen N. Rao" To: sathnaga@linux.vnet.ibm.com Cc: acme@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, srikar@linux.vnet.ibm.com, bala24@linux.vnet.ibm.com Subject: Re: [PATCH v3 1/2] perf/bench/numa: Add functions to detect sparse numa nodes References: <855c8ed2d15135f2ac32105f60a745a4fd14036b.1503310062.git.sathnaga@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <855c8ed2d15135f2ac32105f60a745a4fd14036b.1503310062.git.sathnaga@linux.vnet.ibm.com> User-Agent: NeoMutt/20170912 (1.9.0) X-TM-AS-GCONF: 00 x-cbid: 17103115-0040-0000-0000-00000408E54B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17103115-0041-0000-0000-000020AB69FC Message-Id: <20171031151453.pe2ef33hyjl6bcxo@naverao1-tp.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-31_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=4 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710310192 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Satheesh, On 2017/08/21 10:15AM, sathnaga@linux.vnet.ibm.com wrote: > From: Satheesh Rajendran > > Added functions 1) to get a count of all nodes that are exposed to > userspace. These nodes could be memoryless cpu nodes or cpuless memory > nodes, 2) to check given node is present and 3) to check given > node has cpus > > This information can be used to handle sparse/discontiguous nodes. > > Cc: Arnaldo Carvalho de Melo > Reviewed-by: Srikar Dronamraju > Signed-off-by: Satheesh Rajendran > Signed-off-by: Balamuruhan S > --- > tools/perf/bench/numa.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > > diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c > index 469d65b..2483174 100644 > --- a/tools/perf/bench/numa.c > +++ b/tools/perf/bench/numa.c > @@ -215,6 +215,50 @@ static const char * const numa_usage[] = { > NULL > }; > > +/* > + * To get number of numa nodes present. > + */ > +static int nr_numa_nodes(void) > +{ > + int i, nr_nodes = 0; > + > + for (i = 0; i < g->p.nr_nodes; i++) { > + if (numa_bitmask_isbitset(numa_nodes_ptr, i)) > + nr_nodes++; > + } > + > + return nr_nodes; > +} > + > +/* Please run patches through scripts/checkpatch.pl. There is a trailing whitespace above... > + * To check if given numa node is present. > + */ > +static int is_node_present(int node) > +{ > + return numa_bitmask_isbitset(numa_nodes_ptr, node); > +} > + > +/* > + * To check given numa node has cpus. > + */ > +static bool node_has_cpus(int node) > +{ > + struct bitmask *cpu = numa_allocate_cpumask(); > + unsigned int i; > + > + if (cpu == NULL) > + return false; /* lets fall back to nocpus safely */ > + > + if (numa_node_to_cpus(node, cpu) == 0) { This can be simplified to: if (cpu && !numa_node_to_cpus(node, cpu)) { > + for (i = 0; i < cpu->size; i++) { > + if (numa_bitmask_isbitset(cpu, i)) > + return true; > + } > + } The indentation on those brackets look to be wrong. > + > + return false; > +} > + More importantly, you've introduced few functions in this patch, but none of those are being used. This is not a useful way to split your patches. In fact, this hurts bisect since trying to build perf with just this patch applied throws errors. You seem to be addressing a few different issues related to perf bench numa. You might want to split your patch based on the specific issue(s) each change fixes. - Naveen > static cpu_set_t bind_to_cpu(int target_cpu) > { > cpu_set_t orig_mask, mask; > -- > 2.7.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > From 1576335468855890653@xxx Mon Aug 21 10:17:30 +0000 2017 X-GM-THRID: 1576332506056657646 X-Gmail-Labels: Inbox,Category Forums