Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp156680yba; Fri, 5 Apr 2019 04:09:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiL6sEXFtMDlm1GLcYAvM8RxBvPFRQ+Yb/4H7vok+AmWhaWAaposys8aKllP4Y57jhG7j4 X-Received: by 2002:a65:4689:: with SMTP id h9mr11571240pgr.295.1554462592904; Fri, 05 Apr 2019 04:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554462592; cv=none; d=google.com; s=arc-20160816; b=kulT0lLJXtM5fpRvwstNUJjZTrWfyWBQE0pdxzYHpwomurC2vT8L4WlDvhT8N0hyxi s5c/mvvdbuWKQHcHmYOhNc1cD/0YdAFuGPyhVjKXHELLUHoxD7CdplEQbZc/o9+JVD8K PynA5LXmQ/NhgPj2ZdwndtCJFOHP8gaEvYBnUGJrdmsv2tMAneuhAEfyb94lQq6waCbj QeXlo1QPypqdZGg6Ze05iy6Zt2a+BZWg4Eii74hTMmbBssxuDPwxaJN7/mVgx5N8ip0H yrKXPbqfLzR4XoD4m71UQ6yTL2v1/uXCtaeUgKh4/6CtuhiYzZNONVOQHueSFtDRjGlL NKLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=/nKUcuCQjJE11CtsUu5MXRvk5ibpLAl6G6QDmveu+3g=; b=IdWhcFMBwGSwYfCZw3TlAU0puq/BYkQECTWRUilujJakUJgn3WmrqR/Iz7SG1BNU0H SHrMlSN1nynIMdCTH1MMSMI6bLdTAzqAceu4Uo+ZZgDI0bn/T98QdZfRBr8AqparFImU 7FGfYBya0sPOhJglTco3j4IUr2BcniTvHuqNGabWO26yX3haEx/HSBUvE/klsSJHzOx0 Rr1FNb5hJwNNRiG34pLfww9ppXJhxp5X60s4E9/pvSfiO847jcpgnq5QN90d2f1xk9RT kkfCFVbwQGRhl2dlshWsZRpyfPNRK7anVJSREZLjB1fhK0asTXSs6BEE8BAWMYjVjGCh 8KsQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si18674121ple.241.2019.04.05.04.09.36; Fri, 05 Apr 2019 04:09:52 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730755AbfDELJC (ORCPT + 99 others); Fri, 5 Apr 2019 07:09:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57516 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730497AbfDELJC (ORCPT ); Fri, 5 Apr 2019 07:09:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 21BB489C47; Fri, 5 Apr 2019 11:09:02 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9999A5D707; Fri, 5 Apr 2019 11:09:00 +0000 (UTC) From: Florian Weimer To: Peter Zijlstra 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 References: <20190403200809.GA13876@avx2> <20190404084249.GS4038@hirez.programming.kicks-ass.net> <87wok83gfs.fsf@oldenburg2.str.redhat.com> <20190405110415.GP12232@hirez.programming.kicks-ass.net> Date: Fri, 05 Apr 2019 13:08:58 +0200 In-Reply-To: <20190405110415.GP12232@hirez.programming.kicks-ass.net> (Peter Zijlstra's message of "Fri, 5 Apr 2019 13:04:15 +0200") Message-ID: <87ftqw3e0l.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 05 Apr 2019 11:09:02 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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? Thanks, Florian