Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1959916rdb; Mon, 9 Oct 2023 08:13:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGL/W5eteDGVZ2slexRlETSqNnofj783ABJle/iJZhMOzcELQ9MFAt+oNI4kS5ElMxYkxdY X-Received: by 2002:a17:90a:f195:b0:273:e64c:f22e with SMTP id bv21-20020a17090af19500b00273e64cf22emr11714741pjb.29.1696864395627; Mon, 09 Oct 2023 08:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696864395; cv=none; d=google.com; s=arc-20160816; b=aQbvhPtUo+cpIIS0t8P5m/bdpJiFdbM8Pu16KTRdABQe3RYokotRFSVedsT2s/pa0h hDLRW/zPvVf4I/12g7qzab3gPvfM3yQWF6wV4lu2E1MpQ/gWO9zlYL67emb5lF8dxUik xw6XYOptVIV/B1xA8fNBIuxmglSwD+wvy7gAjUPqYb4G69Aqxop9yPD1J9jNhS9WWeoC BYEyBL42Mk3BEPxfWeWhLcbdp6K9uMx7Khuc8gXOqBzf8pIq3PslgKYCftyKHHYSq5rk 0KtoIOENbsldTgLoTmJHBH6FAOVYSNf6qCvpXKEULl6Hfko8P2wxYjKmrZqtEvmvI1vF 5tXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=lX/vBylIcMRc9YIP8k3FhefyCrF4dn1ywLpr16JKJDY=; fh=sqKrBoTH+QXdiSq7XhQgYrYC6jAH81J6oVmeIkuqUb4=; b=chp9AtcRi39vQ7ojYDwkQN9fBXp3fmq7/lkgCh0Ywt9PKNUFqm1qsohO8Q5aV5lVPu hx3JlAa/Wdbiu2S9Sb/sGI4KwmvpNU0sBnmTZFnkT9Uew8QBIAPqEMVR9nTt/Cc5z+fH 7OdTahkB3Zu+TcnHgdc5XfATac9rOLfBrNuZqWzIYvs0G0PDwoeO08rr1SRxF88llviH q1g6AjP4ZOa6nxPpSmB3utXrU4x/LzslTUD4OwCfD0C/ZW5z0VSet96pZ9uEtJWVPMu+ 0bT8tuunDmikQRtixiEmKFdem8yOQBHiOsdmWedOoVoxDBJEDlynG25yPG3RGS5R0cIL utCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TDHml3m5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id pj3-20020a17090b4f4300b0027724d42e7esi10071274pjb.123.2023.10.09.08.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:13:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TDHml3m5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 40B2C80FCBD5; Mon, 9 Oct 2023 08:13:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376465AbjJIPNA (ORCPT + 99 others); Mon, 9 Oct 2023 11:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376462AbjJIPM7 (ORCPT ); Mon, 9 Oct 2023 11:12:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F999E for ; Mon, 9 Oct 2023 08:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696864329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lX/vBylIcMRc9YIP8k3FhefyCrF4dn1ywLpr16JKJDY=; b=TDHml3m5vpwN0eEGxPzeBvvJAKJgDicjZwyPD3bvFe1Ef9Cskw1njxt7qxFn8ehkNl7XAk +2JhKyfEbI5/RDTOpoq5bbej5HPvTRf8IPRdOjLk8aOKiGl7yAk5TzsSO0WczZaATGq/Gi AiLY44J3PgvEiD900+izg1gX/8sRDrg= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-63-eo28g_okPhiASTwe-EOMPw-1; Mon, 09 Oct 2023 11:11:58 -0400 X-MC-Unique: eo28g_okPhiASTwe-EOMPw-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6557c921deeso58228136d6.2 for ; Mon, 09 Oct 2023 08:11:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696864318; x=1697469118; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lX/vBylIcMRc9YIP8k3FhefyCrF4dn1ywLpr16JKJDY=; b=OP6AwoeCBEUX/L2m9xQ3lwNrdqtUh1KWMXk/YYRNPivmi3btY3oQ11S5Svd7Sh5dLt AvgiQWT8iIGf7W+QX0uKaebHePZtCVgqG5m/8axtSAh63rBe+e+n/QjuMDLvii+JiECH Tb8ojXF+yeUd9wpiOPxc/fbUM/xcYzazVVESumFWxzgABr0Ba+j4An1NkeQjUc/AzzJl 9CfcyWR8YdAsWwRID1lh9XHTA86s9fk1c+Fu2rWX/OENe8XWTSaGRZY+YxL/GbTJ6vQG g+i4C2OHD5AfDcknGSv+ocktVCEyBbAn99KLbZfaFLKJK4LWDp93RyvXd2LCTYO6LYJY 77cg== X-Gm-Message-State: AOJu0YxXjhI7xjW35dd65L2yschTcmlouZ0LG9VpNg66XB0fJbsWPZLy +tC3pyPYyeYMcV785lgfFHZW13FXlNDhIdidbVvzOebmqrU6yTCc60NJdmGWSTNSj+MyC+JdIrX 8TF/St6F9NUN8zBUhEds7MvKf X-Received: by 2002:a05:6214:2e49:b0:656:3407:f45a with SMTP id my9-20020a0562142e4900b006563407f45amr15525003qvb.43.1696864318035; Mon, 09 Oct 2023 08:11:58 -0700 (PDT) X-Received: by 2002:a05:6214:2e49:b0:656:3407:f45a with SMTP id my9-20020a0562142e4900b006563407f45amr15524991qvb.43.1696864317829; Mon, 09 Oct 2023 08:11:57 -0700 (PDT) Received: from vschneid.remote.csb (213-44-141-166.abo.bbox.fr. [213.44.141.166]) by smtp.gmail.com with ESMTPSA id w25-20020a0cb559000000b0065af366bdc1sm3909353qvd.103.2023.10.09.08.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:11:57 -0700 (PDT) From: Valentin Schneider To: Ingo Molnar , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Frederic Weisbecker , Joel Fernandes , Thomas Gleixner Subject: Re: [PATCH 3/3] sched/nohz: Remove weird error handling from find_new_ilb() In-Reply-To: References: <20231006102518.2452758-1-mingo@kernel.org> <20231006102518.2452758-4-mingo@kernel.org> <20231006103858.GB36277@noisy.programming.kicks-ass.net> Date: Mon, 09 Oct 2023 17:11:53 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 08:13:13 -0700 (PDT) X-Spam-Level: ** On 06/10/23 13:01, Ingo Molnar wrote: > * 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)) { I can't see why we'd want smp_call_function_single*() / generic_exec_single() to take a signed int as input, shouldn't this just be unsigned? The perf thing does look like it wants signed though... > > :-/ > > So I don't think this is a particularly well thought-out interface. > > Thanks, > > Ingo