From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF0DAC433DB for ; Mon, 22 Mar 2021 10:42:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD6456198E for ; Mon, 22 Mar 2021 10:42:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230189AbhCVKme (ORCPT ); Mon, 22 Mar 2021 06:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbhCVKmM (ORCPT ); Mon, 22 Mar 2021 06:42:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E557CC061574 for ; Mon, 22 Mar 2021 03:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=jQV77Royvcf/qH4I7ot8EfNxqmNWD9CpDSENY6wCPko=; b=GJUFpV2mF6WwvD8GDwr0HUsxRn M4HG/F2jjYVmNAb/7gg07pQyqf5WLWyFVeUw7GyFHB7N/enh28sD/gUvOUGgxGbeA0qgbqdRW6FTt 9HFmktPlPIj600f6Fn6yJK//8iwMtlTnQeBSntAfbIGsWAHQXIR05Hp8MFFcybMmE0eErBTHb3yVn v4Fu7n0+Rjihh9Nv5mGv2b1PJgtfoqOszEN8EGufSkrdoBvFI3dfDCAbiKTr01g0d51tQnK/D+ZKD y7ZImbXFvF/kj3q4L5hGM3yRjm9Px91v0AxBHpR31X9+LIIs5l71cH9eiLIdElmKVrxCiC4p/xScw CRINE8hg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lOHzg-008MNG-AG; Mon, 22 Mar 2021 10:41:13 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D43A03010C8; Mon, 22 Mar 2021 11:41:06 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B206C23D3F374; Mon, 22 Mar 2021 11:41:06 +0100 (CET) Date: Mon, 22 Mar 2021 11:41:06 +0100 From: Peter Zijlstra To: Barret Rhoden Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org Subject: Re: sched: allow resubmits to queue_balance_callback() Message-ID: References: <20210318195734.3579799-1-brho@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210318195734.3579799-1-brho@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 18, 2021 at 03:57:34PM -0400, Barret Rhoden wrote: > Prior to this commit, if you submitted the same callback_head twice, it > would be enqueued twice, but only if it was the last callback on the > list. The first time it was submitted, rq->balance_callback was NULL, > so head->next is NULL. That defeated the check in > queue_balance_callback(). > > This commit changes the callback list such that whenever an item is on > the list, its head->next is not NULL. The last element (first inserted) > will point to itself. This allows us to detect and ignore any attempt > to reenqueue a callback_head. > > Signed-off-by: Barret Rhoden AFAICT you're patching dead code, please check a current tree.