Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp188205yba; Fri, 5 Apr 2019 04:50:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzut1abIc41hzV2QuOGYsmiahDP6SQ+AClbhZBu3j3N5a91WlcoF2DKcWu5orPFIgEhEf67 X-Received: by 2002:a17:902:70c8:: with SMTP id l8mr12557756plt.177.1554465046064; Fri, 05 Apr 2019 04:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554465046; cv=none; d=google.com; s=arc-20160816; b=BOYOPsuFj7LMWsvUyAtJdoVhAiefvkSE3bujQzaM9RvwKeY78TXEQMhzXQUrrDANyE i1+uLr4jNwCIC+5+JWJjd/axLAX6BeN9UKI5X4V9OdTNvlSFl4Fuz0l/CTpdOpSCv4Uj cX0S/TwaJQbmVoR7bQuOvnFb6YWAN0w0IVZiSxESMDsIfgyuEwAdGRUZkilowHHfZnnb PvOn+HglXypWQPEzv/5Mw3q6/hYwlz5EaGXta7iJp1AHr7hCvPlGZnsJG4tsebs0Yq+r Vn1qwEncFYq/WhW5++X8ZZCi5XW4Ty1tJf/lqNUzLjQvBngxstg7bhS7YF9GxB4U+Q/c V+Pw== 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=mtfJnrvelnlVwd34Fs56HN3yUVDABSncYncMeejOP5c=; b=tRPeCjdVyqB0MgeZCMqqRZ/A5/UF8XoHAM+oYVuuJiUH9fmLr18rZ4zeC20+G9P69W CdLZpWBVEnHyV7TUWzDJZ2n4jyVeOKE9Ygg0D5J97B8PT9z34L7703ciF715Swm1Wyaw TPy11CzQCE9kj2/4lONT+bIlA6+nL5Js/MfN4rtfUqet39BqqMQa4wyfSiZQ8gyuda+t C92zpdX75L2KZSAQBIhjNDvht61wosZWp0gwE1I1H7m+ZtnPDSytRiw9r879IxVQjtyl ZHL55+eLIaRrNqTpKHjxMKHU0T60ENOxjTy0Gp8ujEFd6eMxDGvLNtLqjO9udDJlcBLR 87MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=eZt7NMkt; 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 z73si18736667pgd.345.2019.04.05.04.50.31; Fri, 05 Apr 2019 04:50: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=eZt7NMkt; 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 S1730329AbfDELtr (ORCPT + 99 others); Fri, 5 Apr 2019 07:49:47 -0400 Received: from merlin.infradead.org ([205.233.59.134]:35642 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbfDELtr (ORCPT ); Fri, 5 Apr 2019 07:49:47 -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=mtfJnrvelnlVwd34Fs56HN3yUVDABSncYncMeejOP5c=; b=eZt7NMkt1Jr4qfR0EXFE/Fcjo lBrrfd0gFSbhzZDv07x2ei52eKNhMAqc7jmEkiRp9oaePfIbQzHhHWcAbxZfE9C4LC9ohl6TBD2rD r9V/hYPSGHkCFCdjTTFn2fhygIY/kRqAuiZxQ3bH6NjyUocmN3Jr7509W2n/ek7BsaMq700n5NVOf FqJc3//LmWG/2GzKFnBl+297lnLwFd2BPUYIUesJkX3d7whhZQi/lOakMC1qDMk8N+WNesMexCKEX d/ckKxxIxzNTScpg4D40rbgbQTLo2Jcz8FIjvow/l71wO3tqvDhOuCDd5byvOpLIi37BgmDoV+zTo Djyw7PMxg==; 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 1hCNLs-0004HC-AO; Fri, 05 Apr 2019 11:49:44 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A4D28285FBF31; Fri, 5 Apr 2019 13:49:41 +0200 (CEST) Date: Fri, 5 Apr 2019 13:49:41 +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: <20190405114941.GR12232@hirez.programming.kicks-ass.net> References: <20190403200809.GA13876@avx2> <20190404084249.GS4038@hirez.programming.kicks-ass.net> <87wok83gfs.fsf@oldenburg2.str.redhat.com> <20190405110415.GP12232@hirez.programming.kicks-ass.net> <87ftqw3e0l.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ftqw3e0l.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 01:08:58PM +0200, Florian Weimer wrote: > * Peter Zijlstra: > > > 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. > > Doesn't the kernel still enforce the larget bitmap in sched_getaffinity, > even if the bits are always zero? Oh crap, you're right. That's unfortunate I suppose.