Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2319766imm; Thu, 11 Oct 2018 08:27:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV61HWHwcltlcM2VmM7PRtij/IcxubX4byS24cXoYWZ4sJXQcIVeXg/0wZSLeUXGKUdZY5syr X-Received: by 2002:a63:df4f:: with SMTP id h15-v6mr1791609pgj.94.1539271663738; Thu, 11 Oct 2018 08:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539271663; cv=none; d=google.com; s=arc-20160816; b=Ub+E0Bc1iJiT2s2RezbefIuJujGZXAsY1H2tWbFnkEB2Btyj/ngkKE+9VH8aV0/o7q R/Tk90/6HirDyggGR3oJU3GsRXjOfNF4dq9986wz7lGzDKwe2AmzzKUjZ/l2gFaqUcMM K+cmKr9tJfN5+c0BGqDEaLOVSOoLypsWl3CsVG7GuJrJwDNJprYjXEXYnrZjW3WMZz+a NZsttJuPnjI2oTqctYRPxKun3vcbgkwiUu/SxJn9L2ijbYZYrJyTSaGzD5q3cvYxjEmG wHOtbUmDNGhMhyMvHJaxwPw539LzGDh+DgEfM2gEQ0E0f848m3rS1Qn9pl9OLdxkVz7+ 22EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=miQiWFyV3lLkdNjXe1ZSDxVu+ciOnWcPaTkxIg3qx90=; b=CQaikz0aZGaDyyWxJlnJT8EoAZnMS88ztyrNnAdxIbycHMeZFCWWNMLTqC2cRd/fAJ fGyH7fAMQL6QNZVa0nq7z0Vo0tqOF6DSODxmL3oCsL5VRWSfim3o1ugNpvPWLjNZHQkK ZsoJ1UDZrxH+X3IWHGcqTUeaexqUQqF8mV8k3xbACNfeiKdBwZzCY7ujY6lkj8Ws9gTi DPCCNFR+zaJjbRuIL+nT91Cbz5guuLDPbBsI+OggCTs+G80RjzqrLSa1fanFI+1l/5j7 PE/CNgnbpwm9l851nIBUy7ErANWA8S2C9XFDlZ84gaWxEP0eSTiW1HVWbfnkXC6rdEDh cg2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=F39IcTaY; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3-v6si24999304pga.321.2018.10.11.08.27.28; Thu, 11 Oct 2018 08:27:43 -0700 (PDT) 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=@google.com header.s=20161025 header.b=F39IcTaY; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728831AbeJKWwl (ORCPT + 99 others); Thu, 11 Oct 2018 18:52:41 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:41939 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbeJKWwk (ORCPT ); Thu, 11 Oct 2018 18:52:40 -0400 Received: by mail-io1-f65.google.com with SMTP id q4-v6so6900822iob.8 for ; Thu, 11 Oct 2018 08:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=miQiWFyV3lLkdNjXe1ZSDxVu+ciOnWcPaTkxIg3qx90=; b=F39IcTaYz3GCuUEHKrT6jusudqbRVx+UOOoe3TDZIbJajshM83AiJwuee1lMYXzXjt JQahRkJjosju2uZzEENzdpIkBRfh+pm/eyiMQV+qfO1DbQ4ppiT/xk4VXQWOrFAq3wqb sc6pWxCc0uteBK1PJyPfkMQ+BSROCxWjhRv4Dwjtqnuo7tw2nG9U7xEtnFEbi9CiVCnO ssw5ILnEa7rD6uY9JPpVAu7dJujT12rINdU+MKMKfDY7YCs4rpxl80qqBao4OE7obr9q RoVbjT6MKfC2wfyt7ASafREhTL+dklj7ajUMwbBmHwc88gDeW78A8OZanc7Q9s7BvlMW zNuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=miQiWFyV3lLkdNjXe1ZSDxVu+ciOnWcPaTkxIg3qx90=; b=TyGkcCrj2W4vFViL/5ENTLCvv5Fe+7s+VqQ1Ja3kym4KLzS0L0ipGGzGtlzn6CdZk3 GVRkLgT9uZf/XiO5KJiAQXOtVXwDg9PoDslGuIdZOoNixHH+Fq0GLVv/HrgZcnR8Qp3l pyTeTNzeDrwmb0PrhDIeD625NbM8TjX2yaxdhkyp2NNEzCRVm5tZW2hP+2fbfX/MaLM7 ZN3V4Mk9JLQVuBXlre0bG2h9CBuVCXc0sxVfQEeVRxwygPx4TdhKHF0tNMKZz5Hj8sU0 5OwZvhItFuENCLx9rAOnUBIeeAg3Nq2KKZg+kOakRum9Ycssx0UDQ5V2NGKVEI42MhjL PxmA== X-Gm-Message-State: ABuFfohw+hhyJ/y2TaixW9H2AW3elVI7XOM+w4ueg+VXMz8N2ZhGa7Op bdHrThUekc76ZATEjzgvS1UeoSzqGuAeIFyh0uTfoLlV+cknpA== X-Received: by 2002:a6b:8f93:: with SMTP id r141-v6mr1463016iod.118.1539271500674; Thu, 11 Oct 2018 08:25:00 -0700 (PDT) MIME-Version: 1.0 References: <20181011103825.023036082@infradead.org> <20181011104019.748208519@infradead.org> In-Reply-To: From: Eric Dumazet Date: Thu, 11 Oct 2018 08:24:49 -0700 Message-ID: Subject: Re: [PATCH 2/2] x86/percpu: Fix this_cpu_read() To: Peter Zijlstra Cc: Ingo Molnar , Thomas Gleixner , LKML , "H. Peter Anvin" , Eric Dumazet , Borislav Petkov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 11, 2018 at 8:02 AM Eric Dumazet wrote: > > On Thu, Oct 11, 2018 at 3:45 AM Peter Zijlstra wrote: > > > > Eric reported that a sequence count loop using this_cpu_read() got > > optimized out. This is wrong, this_cpu_read() must imply READ_ONCE() > > because the interface is IRQ-safe, therefore an interrupt can have > > changed the per-cpu value. > > > > Fixes: 59eaef78bfea ("x86/tsc: Remodel cyc2ns to use seqcount_latch()") > > Reported-by: Eric Dumazet > > Signed-off-by: Peter Zijlstra (Intel) > > > Acked-by: Eric Dumazet Actually the Fixes: tag seems funky. Bug was not added by 59eaef78bfea Your patch probably needs to be backported to older versions of linux, just to be safe, since we might have other places where authors relied on this_cpu_read() semantic (different than this_cpu_read_stable())