Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp154086yba; Fri, 5 Apr 2019 04:06:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxP/lZ+LdA6WI0L5K3PZiUFpMu9pc+x99vrnQ+YFe2Jyd+4caK4gBW+tuM3JcxUQR/ZUVEI X-Received: by 2002:a62:292:: with SMTP id 140mr11945500pfc.206.1554462406918; Fri, 05 Apr 2019 04:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554462406; cv=none; d=google.com; s=arc-20160816; b=g/K6jnFBBhcHR24ifvvev6Idk8GqMxxILZRBdnZgG4SEShKEs5Y+HMUS6dFEOa/ovq SYJrcNmd8ilvV+CEc5cGPCb2DxzSwZeDqvPRgq/lb0UBsVMo+VTht0X3OTi1SPZ+TH4J b+dc7JIzQFCBXlv7BwsuqIugIqL1h5Csj6ICysEwU0TDaPMhPZLPsAmVqiUd3zlFLbY4 16PBcKYarGZILH7AV9MBQJuFzcWPR3hv8Y+PojYojtECMIsdeo+DLbAfjDsh9iJMBgbJ zNUDQ69EAYMsnSbEcFi5bF2/oC01gzNGhpGr4jHxjVwB5UCu9kZz+otVgnFhWlwQWG/h irAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tK5zfbhT5Ego+Q1oTlHmUvYN1T2+Z3c1MXEukS68Ees=; b=WBWYmyEMJdYNLK2V5eBsx955rEgcMjWBTh3qTg3uhzk8VtVrvQ6mdrg/EYtoyd/FM+ NbK9AYNztwJRQ/q79JGZ7TS65KwwqqXeKPHeIvOCtpPRDYxCNEd7WckDuLEUtFjl+Ksp 2LXVvhaAVLSNq7Bi05dC0FrlF3X/5VNNniHc5iap3soFDE2tBWQfLVxRuu1gw9BqKFQe vH6qA+p/20GVsYZvMQnJmP3Vd1KP2fTlCygRh7nq7svaQrqFyqBh+xw1RiQ3F9GXFUmp pIRhDl9xHsEh20aW+NEgZO09laN5KnETYXq8SBU9gxuSIFY87bT3NYAJzTsn7Ms2h0j7 umzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ErYDw41F; 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 i7si19467148plb.410.2019.04.05.04.06.31; Fri, 05 Apr 2019 04:06:46 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ErYDw41F; 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 S1730826AbfDELEU (ORCPT + 99 others); Fri, 5 Apr 2019 07:04:20 -0400 Received: from merlin.infradead.org ([205.233.59.134]:35420 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730625AbfDELEU (ORCPT ); Fri, 5 Apr 2019 07:04:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tK5zfbhT5Ego+Q1oTlHmUvYN1T2+Z3c1MXEukS68Ees=; b=ErYDw41FD1rT+GRbS/TQbd13C CP85240gX2TnV+2suNGgIrXjDdLEgw7BaMGg2/A/eQl0aPNj8OO50aS5tVaL8FB9IJA7JX9/hbcQo 2Gdm5e+0DOt4/wrSGAgc8Aa6YndhtP9z1hU1F4nVmYrVT5n6sbsJX6AgS1jORdNNo2NaV4y2lBjGU 2bV2z4lwSsnso3iVioxfgj8JbhWyAbl5gUH753OS/EOkzsbsEc3PdBhhGAGwQ1L+etMecLly+8vzR U++kGSq72hhTTkZOeGKzEa6m0li216tQC/+fn9F0dC68Xv4ltYD2KG8BHfOo8NsfbmApaqEo/U6v9 I1ShJ8psw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hCMds-0003aV-OY; Fri, 05 Apr 2019 11:04:17 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6A28521AA0DE9; Fri, 5 Apr 2019 13:04:15 +0200 (CEST) Date: Fri, 5 Apr 2019 13:04:15 +0200 From: Peter Zijlstra To: Florian Weimer Cc: Alexey Dobriyan , mingo@redhat.com, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH] sched/core: expand sched_getaffinity(2) to return number of CPUs Message-ID: <20190405110415.GP12232@hirez.programming.kicks-ass.net> References: <20190403200809.GA13876@avx2> <20190404084249.GS4038@hirez.programming.kicks-ass.net> <87wok83gfs.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wok83gfs.fsf@oldenburg2.str.redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 05, 2019 at 12:16:39PM +0200, Florian Weimer wrote: > > True; but I suppose glibc already does lots of that anyway, right? It > > does contain the right information. > > If I recall correctly my last investigation, > /sys/devices/system/cpu/possible does not reflect the size of the > affinity mask, either. Strictly speaking correct; the bitmap can be longer than the highest possible cpu number, however the remainder would be 0-padding and could thus be stripped without issue. So a bitmap sized to fit the max possible cpu number, should for all practical purposes suffice.