From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15F5B1F471B for ; Tue, 3 Dec 2024 17:21:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.67.55.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733246515; cv=none; b=Erlts/kz8dZD59BzbUjw0M3Bilz5n9SCKvjtW85Bd+5SBX+Q6NgXUT4vfv67q+MxCzhGGfIFBWUBbp9C1w4MVyKIM6Egq2KNuami8PqnYkuegXKou86Vz4L4BEkmrULl8ClOaAiJ+PdefexnqWUeWVCxb1XOT29cnhcM6L0P/lo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733246515; c=relaxed/simple; bh=Mph9ZWPb78z1yfeoiO9dyD32B0Gh6V1IWrfxxJOWoU0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=btv6B61rg+SwG/FYdqeM4UBtXQYb0ZkgLNQ9qZckPdSHM/ZeHwZBtZ70lYQkbxHbWhPgcDKW0Q77RZ21c7g5ebRaFqvwhAGPVbXIq/MHRrowS5ibauXqal03ESXp3SbwHtqpCEEzj+X9e0mHqaNKiXUhqglafLzREDZr80FX3IM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com; spf=pass smtp.mailfrom=shelob.surriel.com; arc=none smtp.client-ip=96.67.55.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shelob.surriel.com Received: from fangorn.home.surriel.com ([10.0.13.7]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1tIWaf-000000008IC-31LT; Tue, 03 Dec 2024 12:21:37 -0500 Message-ID: <207d3b2abb0a9ead709de7b4710e256563b02f3b.camel@surriel.com> Subject: Re: [RFC PATCH] smp: Evaluate local cond_func() before IPI side-effects From: Rik van Riel To: Mathieu Desnoyers Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Dave Hansen , Linus Torvalds , Mel Gorman , x86@kernel.org Date: Tue, 03 Dec 2024 12:21:37 -0500 In-Reply-To: <20241203163558.3455535-1-mathieu.desnoyers@efficios.com> References: <20241203163558.3455535-1-mathieu.desnoyers@efficios.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.1 (3.54.1-1.fc41) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: riel@surriel.com On Tue, 2024-12-03 at 11:35 -0500, Mathieu Desnoyers wrote: > In smp_call_function_many_cond(), the local cond_func() is evaluated > after triggering the remote CPU IPIs. >=20 > If cond_func() depends on loading shared state updated by other CPU's > IPI handlers func(), then triggering execution of remote CPUs IPI > before > evaluating cond_func() may have unexpected consequences. >=20 > One example scenario is evaluating a jiffies delay in cond_func(), > which > is updated by func() in the IPI handlers. This situation can prevent > execution of periodic cleanup code on the local CPU. >=20 > Link: https://lore.kernel.org/lkml/20241202202213.26a79ed6@fangorn/ > Signed-off-by: Mathieu Desnoyers >=20 Reviewed-by: Rik van Riel --=20 All Rights Reversed.