Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4410033ybf; Wed, 4 Mar 2020 03:25:16 -0800 (PST) X-Google-Smtp-Source: ADFU+vtQh15Aexw8vXvnyMk8Hys9bvpqWkQ+qCI8gf0nscXGhlUiFBZg5OULTJ0jHH9F/OogdcAt X-Received: by 2002:a9d:4c96:: with SMTP id m22mr1837792otf.21.1583321115823; Wed, 04 Mar 2020 03:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583321115; cv=none; d=google.com; s=arc-20160816; b=R6gu4hJNhjoYALySpzKBvhvqMKVzfQx839T2g6RSeshJkOYlobdeIEadObjg3FbBcp FyWIBJF2/tlccT6AyCOVEq3WGRXqI1s7LrtfcTq7UTmfaEFEsCEN0if6ACgYNh8gq4wE v5sAdMrb6KRUikbay+PQvCnQ0nRjDbq1J1+9+o4nMnDKx+kgZu6QdopITzBiHYXRLw/L CGLgnXWQQEDuSvyw6fY9SsT7vjcWnp/wiQG0RxwfD3sWnZ4NWgEEI4vvH/l818oMzRSo r71f1Rd4kEbgCDWOKfzPdk7FP+Op+8u5lB4Jnvdqfo0YNfSWyBkoLlmydZYPe0wYtmBp 8UZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=KmlYKKcnxp0xUf+Q/ijvadcck+k5qHRJOLBpEFhtRdg=; b=h9EJWuCrI0w5eotXKcIMaJCjn9nE1BRN3nO3nDc9LnQyAYCh0R5QwjLVmAD5JL+f9T Y0TWsc+yhhchvDeqWoBFJ53uljsavDYOneMvsrXzmVTwt1kfWd4iHcP0ubQAfcMPxXyl K0VIV0tz3Re/Lx+k41I8sUP86eg/LPDA+KjmO32GZE7eweWH8roXtP8IBK+Gm+7vnobj sGpwggareHw7G/XtL8VbkyQgSfzN4w3EIqKu/cTgyM04+DsEevm0zTfbfkpONzJtq/++ g5fEYB/2h+x1iLI2WtaAUtGGTeARZCqkgFMy0gkfEfe7C7bxb2UE8zAtX8P5Ccd/7USM 0M+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=qNkSBjnf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si1004114otk.173.2020.03.04.03.25.03; Wed, 04 Mar 2020 03:25:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=qNkSBjnf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729261AbgCDLYy (ORCPT + 99 others); Wed, 4 Mar 2020 06:24:54 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:41142 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbgCDLYx (ORCPT ); Wed, 4 Mar 2020 06:24:53 -0500 Received: by mail-qk1-f194.google.com with SMTP id b5so1158327qkh.8 for ; Wed, 04 Mar 2020 03:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=KmlYKKcnxp0xUf+Q/ijvadcck+k5qHRJOLBpEFhtRdg=; b=qNkSBjnf2aR6RgjanokMRTxLacwrp//7hYWYDDFAP2WDKFupuwuKnL4pNzwmR/f79g f44aqKSLTSTkJfMajw4oK59jHhmNXsBM6i15eGiQpAo8JQ5k36edLSh1zr+d3QcWPb6Q hekjzqeY5ksYVjTV+aohnmxcJcY/JhgKuWIC+gKVtWpgFnwJNXFA3bmNv3DMW5FK9fLH luVPyZU84Mg5ubOg0rMlYu9qb3ggaJuRuqeJPNJuAUOl1QW6vFupc/Zf6NeNhp2BSGvU mBu2De7n2MJHyQ0Q56KwzcNH9igajBHAyQaXnFZ8xBIJN/E5ZQlpJH7f9DaVFf2/sG7w W9oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=KmlYKKcnxp0xUf+Q/ijvadcck+k5qHRJOLBpEFhtRdg=; b=jofp+UntObeV7bhHvPkEB1pcQeBzcbI8UiRFVoLz/XqK+xpRIrjyYss6h97xZzHIpk yi8Lkf5AAglgExwMis+oZo5QBBHWV2cG6ef9qoVBi5gfH116tCDDm11vwdkx6o0GP5JQ r47etK6b+NvsF4RohyR5g+Gc1P4K/TBWqokYf//oQYk5xz/tAOP/DDe+gzqAfs8u/3D+ nMYtwH4oB53JgI6Sz78L7uKHKN6E7Gp9DiWzGMEkZiNY3EF7evOE5fSTL5ZGG2m2C2je y4oo7BKk/ryxRXUQ0rsQEzZOtkr92PHGH4wNefJMi4FN3imY+7RsTdajyRMow25EkOM2 6gmA== X-Gm-Message-State: ANhLgQ247xDWw346nrOnfm+RHIqccjXxq89B7ljkLcEWahURN9FUcnj4 t8skGNo//9l1IDNCvMjEOS59Bg== X-Received: by 2002:a37:387:: with SMTP id 129mr2472915qkd.293.1583321092904; Wed, 04 Mar 2020 03:24:52 -0800 (PST) Received: from [192.168.1.183] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id l3sm6137838qkl.100.2020.03.04.03.24.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Mar 2020 03:24:52 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] tick/sched: fix data races at tick_do_timer_cpu Date: Wed, 4 Mar 2020 06:24:51 -0500 Message-Id: <93F1BB73-8891-46EB-99E0-DD6C87209945@lca.pw> References: <20200304095647.GL2596@hirez.programming.kicks-ass.net> Cc: Thomas Gleixner , fweisbec@gmail.com, mingo@kernel.org, elver@google.com, linux-kernel@vger.kernel.org In-Reply-To: <20200304095647.GL2596@hirez.programming.kicks-ass.net> To: Peter Zijlstra X-Mailer: iPhone Mail (17D50) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 4, 2020, at 4:56 AM, Peter Zijlstra wrote: >=20 > Worse: >=20 > + if (cpu !=3D READ_ONCE(tick_do_timer_cpu) && > + (READ_ONCE(tick_do_timer_cpu) !=3D TICK_DO_TIMER_NONE || >=20 > Doing that read twice is just utterly stupid. And the patch is full of > that :/ >=20 > Please stop this non-thinking 'fix' generation! That is an oversight that could easily be fixed. However, blaming about =E2=80= =9Cnon-thinking=E2=80=9D is rather harsh. Do you know I had spent weeks read= ing about memory-model.txt and alike just to get better at it?=