Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp296135rdb; Fri, 6 Oct 2023 04:01:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdV+ThpVwrj11gLf9Up2YZ/jXg/MThzpFfe2F25gC8ew7QqQnLIIekHzLH/yzi0KOBOotI X-Received: by 2002:aa7:88ca:0:b0:690:ca4e:661e with SMTP id k10-20020aa788ca000000b00690ca4e661emr8629102pff.19.1696590104159; Fri, 06 Oct 2023 04:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696590104; cv=none; d=google.com; s=arc-20160816; b=XWZO2dOeHEOc8zAiSB6pZWJTkUcQInfg9wEaQeiRzFeD9X+LShm1UZCiKH7kY1LFOL b1L+SZhyZ4FxbcWi1d7dSyDVXwF8UXvNjbbgytU/eU6cOgpMDwpUaYXtVmJacSjsulpP qIK8pHgch1FnLuxaxsHqbJUAXp/4Wi6SnbN5sQjRPz2xRB2n3j8Pr/8D0LgJ4ULtpNzN 3ir8H1BMLowZFz5IAGW8s78+7VTgJbm0n4/LWEekQcCl1iraDtO/TglalVPOlGTQs0ZH 3k4pLBKF3s9GvnzxEMblUWRRVctFOIlZqgxupvHY7fR44h7axvZdNadinynK5vtkZOza srqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=54GkJ799T1y0yQUmcVNhrGWVDiHwsfgV5Ye0eDD6kMM=; fh=RC23ye9yW6/lIqQJAS4MRdAe3Ne1MbdlJP0JUQe/CcQ=; b=bPHAnJpOixy86K+iVjZgE1Dsdb9+imvKhk4MsQGFeztxTH4YW+8bgq+y03GYnXJLKT QEFldnDBCXtfby6KDzo9IeX1yf7CEaopVPkbpogCOuBjYti47nc6rg6QVnPRkGDW/G4J e2w5EKSwRpHooBXwFXmJBI0frkds+7JU1tCOC+srZgmB47TVCRrOzlWr3TA9KDxW0qXL wqLx6PKtazRCoAL4t/plsw7jP+mObuPBhZZHWg1skej/XOT2qO8ce3kkF1b6CCXgktlH GZwisIJzD3pEL7pyJJldXrK+mQPQIAwszbDO5LHUnNOuzcPGg+h5QomqG566EbZ53guD n/+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L5URv1hx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id m22-20020a637116000000b00578a66db83fsi3450956pgc.141.2023.10.06.04.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 04:01:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L5URv1hx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C6E7C80BA972; Fri, 6 Oct 2023 04:01:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231820AbjJFLBO (ORCPT + 99 others); Fri, 6 Oct 2023 07:01:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231312AbjJFLBN (ORCPT ); Fri, 6 Oct 2023 07:01:13 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BC1AC5 for ; Fri, 6 Oct 2023 04:01:11 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9936b3d0286so365129866b.0 for ; Fri, 06 Oct 2023 04:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696590070; x=1697194870; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=54GkJ799T1y0yQUmcVNhrGWVDiHwsfgV5Ye0eDD6kMM=; b=L5URv1hxGhe+vr9xPGmasb2vDF52hAG8J6qzKAIatXBelzL3M2yt2WEg2KkSjlZvYm kI+OBWfaClkHQhoekVyRpXvp2tNt6ka3P2peqi24EpQwpdSW1LoehGxE60NyTL2v59hB Gd9zthQBFnaBhlBdpNGWe+S6GUxRtc2rQaU8U9iBV6lkVmai/SUiiARonHTwaAU7Xbod hVEaoAUMEBZxTx+fDMniz9CaNqgZyQY4T5fEqO+W21TRQlh508T5eaCGNzVRh/a1SKuW YhHVi40nJ3V0bamhisPix5L+s+GG2PFFD+xr56Uj6kuA50P4FaGcyzd5O7WZaDs/UhD0 q5NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696590070; x=1697194870; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=54GkJ799T1y0yQUmcVNhrGWVDiHwsfgV5Ye0eDD6kMM=; b=I0xaFDJoYoJkZDo8OKLOKuPqlD/pGcTopFrhHMuJzDnjg48Tm7oi/KAe2Ed1r+b+hU qH9pJHZ7Bc2/Q5BZ+4bQASGl78WkAdGkBtapW4Ixa6J/9ygpNVzEeBVa+ea21g68rqx/ +LOTKmMF47xJW+oXRHk61k7jFdi3RYjx2doqG3o/3k1GiFPc2963mnqH0BzzyFRPG+7D 0R1WsN3BFjSU/w2ZJIN7bWlmbQEiFENyMqFZf9feKmupK42iQGPb7dFc7bXcANdL8fjd EwzkExMIQQ1zi3QwLHynDTfUrkeBz+w3koCu2Xadr03hWEfEhVFjnQLIQ6MXKn1NbtA8 mDxw== X-Gm-Message-State: AOJu0YwGRSQTQ+HN0mIZtxLkDM8f47tq/6M/Kqp47C4UsuF2YVBRWmhL 1eUs2YVe53m1ei0EiB7lJVg= X-Received: by 2002:a17:906:5357:b0:9ae:7681:f62a with SMTP id j23-20020a170906535700b009ae7681f62amr7734306ejo.44.1696590070024; Fri, 06 Oct 2023 04:01:10 -0700 (PDT) Received: from gmail.com (1F2EF530.nat.pool.telekom.hu. [31.46.245.48]) by smtp.gmail.com with ESMTPSA id y11-20020a17090629cb00b009ad829ed144sm2687815eje.130.2023.10.06.04.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 04:01:09 -0700 (PDT) Sender: Ingo Molnar Date: Fri, 6 Oct 2023 13:01:07 +0200 From: Ingo Molnar To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Frederic Weisbecker , Joel Fernandes , Thomas Gleixner Subject: Re: [PATCH 3/3] sched/nohz: Remove weird error handling from find_new_ilb() Message-ID: References: <20231006102518.2452758-1-mingo@kernel.org> <20231006102518.2452758-4-mingo@kernel.org> <20231006103858.GB36277@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231006103858.GB36277@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=2.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 06 Oct 2023 04:01:23 -0700 (PDT) X-Spam-Level: ** * Peter Zijlstra wrote: > On Fri, Oct 06, 2023 at 12:25:18PM +0200, Ingo Molnar wrote: > > find_new_ilb() returns nr_cpu_ids on failure - which is a weird > > choice in itself: not only is it a global variable, it is > > a +1 out of bounds CPU index... > > FWIW this is what all the cpumask bitops return when they've exhausted > the mask. Eg. no bits left set etc.. yeah, which then results in type-forcing uglies like: kernel/events/core.c: if ((unsigned)cpu >= nr_cpu_ids) { kernel/events/core.c: if ((unsigned)cpu >= nr_cpu_ids) { kernel/smp.c: if ((unsigned)cpu >= nr_cpu_ids || !cpu_online(cpu)) { :-/ So I don't think this is a particularly well thought-out interface. Thanks, Ingo