Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp785424rwb; Thu, 19 Jan 2023 02:39:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXs6CEHt4/xYNA4kEC3xCtU1r5UD84T6v26jdFHdycyd11EA1R3QRXlddhEsRQkJ8iOMNPFB X-Received: by 2002:a17:902:8215:b0:194:9106:1ab5 with SMTP id x21-20020a170902821500b0019491061ab5mr9132164pln.34.1674124789349; Thu, 19 Jan 2023 02:39:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674124789; cv=none; d=google.com; s=arc-20160816; b=YazV5YibW6+mdU3nK+vgKWKN6zrvZS5ynCmB/HCISKR1e71xqgmwrEr8gufmcRab+u AX+tSF1tZwc1b4LO2/UNh9LMstAA0hcZgr0gZo1pHGPcwdFKf6Z4CXnQppgXPDeUklGp rfwXRxEbXesC0Gb1pZLU+81GV0f4d+0ekaHGIAomCTjqNikvj8LU9u+5B6hLX/jH0hmg S7wK5gFA/kCvYuN6Z3WGJrUQv+YSXP+Y17etgdmgQEERBArCOuYk4w+BgTEvsVwQgpG9 tH0Yy2eRIWr+1ZOxJUXZlbsh94Ece0g15zr9JNjB81DAlhm2kiHIlGUF90VWRmIVRzgu zC7A== 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:dkim-signature; bh=tM5eucsKyZ8YXT/h1+DWCYLTkr+tyomjmSjGh+s+X9A=; b=HpbQt/FZi4PUHlZYFldy2UvbPSUgibjzH4ewcfLw6Ae14p0PwPdemcJfUIAd+zZJe8 Fs+RvMry4WNHNb+ji1ZYmtkhDhNEg2FobC+Xbd5euiwpV6swo52hGVNQo8Ny7aujYlOb hIyw9QJM8YmodBtngfXsEW85H+nRmWS+DEiYiSwTA3hvTsBXGCpvDUxDEwVDomu9ha+0 7aYeyOTz8RtAv3OEQrfiyZBgO0S1tjGDHUj1B49MS1Fm0kh92hF+SYreRkjiYbYFqN0U mlUxDhWfEc9Ve1m4f1E+YjWyn/CHxiIj/UU4sPjUwMeLFtK7xMxgi/JSazh10j73ARX3 O2wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=l5JhPGV8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020a170902b49000b0019295a19dc8si14885361plr.468.2023.01.19.02.39.44; Thu, 19 Jan 2023 02:39:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=l5JhPGV8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbjASKKG (ORCPT + 44 others); Thu, 19 Jan 2023 05:10:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230336AbjASKJy (ORCPT ); Thu, 19 Jan 2023 05:09:54 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94CEF677A9 for ; Thu, 19 Jan 2023 02:09:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=tM5eucsKyZ8YXT/h1+DWCYLTkr+tyomjmSjGh+s+X9A=; b=l5JhPGV8krFx7BDySqGXk+Tdo/ +edGzDMSt/cu+bc1AdqAmflOtLJrAv5nHVL7ZRLYXrorGzP7CuD8fPrLxIsUWzXQ/ZxSlXQrkQfay Vm9DYAV4PXqNsPumA+aiRtV7RY5p8RInnUt0CHqRT43t7dKnDxoeJB56GVw6oxiXpTTlkfmatC7eS Vk2ewDZpXwzv/2VP+xNdheFWGMdgypQvffnn3tM/DYCh3OIue13/9dQ6TiAgpVyaCiebF1izVO4Qm sBv7SW7OJkjzZ0BbD3PJWeAVXXZUlLo37OM2PRhbGw3slxEVYXhHEXFAO114ySy82wdg/YDjWt/YS /ngOuE6w==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pIRqz-000Fo1-1w; Thu, 19 Jan 2023 10:09:06 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id C6E263002BF; Thu, 19 Jan 2023 11:09:31 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A40AB20306BCF; Thu, 19 Jan 2023 11:09:31 +0100 (CET) Date: Thu, 19 Jan 2023 11:09:31 +0100 From: Peter Zijlstra To: Andrei Vagin Cc: Andrei Vagin , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , linux-kernel@vger.kernel.org, Kees Cook , Christian Brauner , Andy Lutomirski , Juri Lelli , Peter Oskolkov , Tycho Andersen , Will Drewry Subject: Re: [PATCH 3/5] sched: add a few helpers to wake up tasks on the current cpu Message-ID: References: <20230110213010.2683185-1-avagin@google.com> <20230110213010.2683185-4-avagin@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 18, 2023 at 10:45:33PM -0800, Andrei Vagin wrote: > On Mon, Jan 16, 2023 at 1:59 AM Peter Zijlstra wrote: > > So I hate this patch, it adds a whole ton of duplication and litter for > > no real reason afaict. For instance you could've just added an > > wake_flags argument to swake_up_locked(), there's not *that* many users > > -- unlike complete(). > > > > And for complete() instead of fully duplicating the function (always a > > bad idea) you could've made complete_flags() and implemented complete() > > using that, or something. > > > > Anyway, let me go (finally) have a look at Chen's patch, since that > > might render all this moot. > > If it is the only concern, it is easy to fix. I think I decided to do it > this way because swake_up_locked is in include/linux/swait.h, but wakeup > flags are in kernel/sched/sched.h. I agree that it is better to avoid > this code duplication. Thanks. > Regarding Chen's proposed patch, unfortunately, it does not solve our > problem. It works only in narrow conditions. One of the major problems > is that it does nothing if there are idle cores. The advantage of my > changes is that they work predictably, and they provide benefits > regardless of other workloads running on the same host. Oh well.. carry on then. Can't always have two birds thing I suppose :-)