Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3320081pxf; Mon, 22 Mar 2021 03:46:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPwSOwHuuPLCkg3AbmnvBHnNmsG5BoNjUEM82Yj19uv2P4V5b7M1mS1EAgWznFnB6PFZGM X-Received: by 2002:aa7:d954:: with SMTP id l20mr24931767eds.1.1616409963833; Mon, 22 Mar 2021 03:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616409963; cv=none; d=google.com; s=arc-20160816; b=Nb78VU18HJRg6nuwKECyK2JWq22CjE8vCkvpa3IDU8CJHLOC8oQaFKIVpmzVDEDd0O kfnlxQcpxmtkCj2V7w5DaYKTCUi8L7hFPQk+1BgCRIKPOueiiJ7K8KatNno82Du6EAt0 VIMONFfRxK2mz0HG1xDvZNY79jsrteAXFfSP/yUc1uToCGIgzJpNeoj4Uo4LHcmZFoTo mA0UFjKIHXCDkC0JQ5TOq8PRyDi9zkaSxVWPxanKZCK2AzDmT/FhbAS1aBmvmn6HIns6 0RRyjH4KzLHED5GEFOCes6kLw+/oCrheUzXeNCW9ykK3K8KlWJZNQrpIBWIfIJRJT8kp 3/8w== 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=jQV77Royvcf/qH4I7ot8EfNxqmNWD9CpDSENY6wCPko=; b=tdEdm9dg8dKFj5fd3ajLemcGpCANh2Cjs+WNSIgOVZ6yOSFCQSR5Wfhbeh9Gi9QAVp cobxIx8XpcVKXd2mV+6OIDHUjC0pqmnt0XkTqpK3E1GLOX4mDH/fqSzE4+wsCas9LJAc zTYQBdaXlTuHpRQZL8pqWggLhx+jePZGaE0hyxSznCdHINgAgKcAM/SYzwF1eoOxnOQB 0TCY9FXAn3J+GPM/anmz/m+ZmrjDYpA/HcinF6cZXcYVGXH5iSe7NNcpo1P/rar0LEXS SzwcK+MDx5utceiC9Nj0Mn5iRarZQfnuh1jGGhIU/8LnJsFL3Kg+iDIvMGuaf073so3c sr4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=GJUFpV2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si8349664ejy.630.2021.03.22.03.45.40; Mon, 22 Mar 2021 03:46:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=GJUFpV2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbhCVKmd (ORCPT + 99 others); Mon, 22 Mar 2021 06:42:33 -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.