Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp2032180img; Wed, 27 Feb 2019 09:18:58 -0800 (PST) X-Google-Smtp-Source: AHgI3IbN5awHN6uRaWkUvWWhq43VhnnzSbwUOdBUMNPNCH5dGLZ/GQsoURwVzwI2lmwgDsl+2qvA X-Received: by 2002:a17:902:5a8d:: with SMTP id r13mr3226696pli.190.1551287938535; Wed, 27 Feb 2019 09:18:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551287938; cv=none; d=google.com; s=arc-20160816; b=LtXU7YvAcTP4Xj2PeiZIgAxjTPQbHonrilW2b3Cc4XmAlW1Y3/JNObaiodnr5hJiL7 bFbc4mfbXUDhUtF2XiKGP1HqmtFl4CPjD5HyNh+8tEVPPqHPZDFLmWMAVgL6RjtqF6Hq A0q3doP/nXbqTfcwlLkMKC+0vvRhuBTuUIeTjxxL49wC+t4cC7kW3C43AsEP7H+IKr3D iIp2dJpzbyL0hLlo0Ujan39QTJyJUGeklNX53yXdg5m3+aIWPdhahdjbWiA7z7cCADI3 hIjFJ21o9C4q/XH4q4ik0PyxFbV25eFpN7sTE19+UAgzE1KSZeIIpkKxWUjNtR6mTt/1 tGDg== 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=H60UoctTfrVTwseB9DbPRRi9aUfzLXxDvttuU56rYTo=; b=MwwQcYnIEI36fsBn0kmjSK8DdtcXP+PDW7rMNy9rPqMvgadwAVfYQygRWrkEz07VF3 eUmLt8a+PFS05qp4iNcZZ34K8vaEtfl0umSpNw7kyJFPbNbth93fvswyIYKJ0j9XC9T8 AIgdASR+hcy6o9RDoHRwFCsahuUUvHmJsqQttyJpBGyaB5RjcFjsfPnZJURQWYJ2ZDqQ EtgXWOYo3XjPXKHGVWYMYO7Vcy+tuJzDQA0p+9S+EJ8Orv97mZhG3S8OjDKJ15zsbotn HYKVpp6xXa3kCCtGG9C8mfDpK4CUk7PVYNvCoib47cx1KGdg026RMnISY50fgWQc74HO SXTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=NBGqm2gb; 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 j2si14500033pgp.418.2019.02.27.09.18.43; Wed, 27 Feb 2019 09:18:58 -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=@linux-foundation.org header.s=google header.b=NBGqm2gb; 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 S1729782AbfB0RSE (ORCPT + 99 others); Wed, 27 Feb 2019 12:18:04 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:46818 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726223AbfB0RSD (ORCPT ); Wed, 27 Feb 2019 12:18:03 -0500 Received: by mail-lj1-f195.google.com with SMTP id v16so14628195ljg.13 for ; Wed, 27 Feb 2019 09:18:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H60UoctTfrVTwseB9DbPRRi9aUfzLXxDvttuU56rYTo=; b=NBGqm2gbE5Sxe0yBMbEiFWs3iq+u1sALMexAXT5CtbAJZ3hJ4cp2GbTCcYJz/Q3I/y 4gh50bxvstb6G3C3WmIaae8Nm9/Wt4LXT9eey7ubzPupHx0etwIRs9caxlzGmhygXl40 iCDBpzlgfRpzZJaEOpoMiU5aAEnmDEp+FKGcI= 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=H60UoctTfrVTwseB9DbPRRi9aUfzLXxDvttuU56rYTo=; b=cKl2EoHa8lodGPdBE6Mucu/nO40eYjD8XPvGk/tchLnALpw3HthqAJolFF0/L7a78i qBQxVWYk2ArfgfoKzZuGEBKRRCpEFTGzeI1l46lZcGpo4CSg2AOz0iVy/QzX/mNHFjSV ujIyg4GinGXDsJjaqEdG18z+W5s+yL4/z07aLrPxnf2JILOazDpquD48cJ5OHr4atvhM EG6euyg0JZU/ctf23KPsDBPEA8zde470rLwNGzT1yGWdpJ0hTcl8bQFI3fvX1RX+F2jO 02TTxVTHoBRIjVBULIPH26ENEhSCU6SJKS3p33r/LMYSgMzZojXS1s36Y3lBumgGKSP1 Q3Sw== X-Gm-Message-State: APjAAAUdU8ANhiqiPXIdnEOwuoyn6rLR1K1lX4+Fbfp4ncr29tCcwMUY 0t1VnLzXM/e7byzag4vlAJcy96jtyfs= X-Received: by 2002:a2e:9d85:: with SMTP id c5mr2293000ljj.70.1551287880456; Wed, 27 Feb 2019 09:18:00 -0800 (PST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id e21sm925013lfc.90.2019.02.27.09.17.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 09:17:59 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id x206so5073020lff.3 for ; Wed, 27 Feb 2019 09:17:58 -0800 (PST) X-Received: by 2002:ac2:415a:: with SMTP id c26mr1662037lfi.62.1551287878449; Wed, 27 Feb 2019 09:17:58 -0800 (PST) MIME-Version: 1.0 References: <20190227101252.413192716@infradead.org> <20190227101544.210748832@infradead.org> <20190227164806.GS32494@hirez.programming.kicks-ass.net> In-Reply-To: <20190227164806.GS32494@hirez.programming.kicks-ass.net> From: Linus Torvalds Date: Wed, 27 Feb 2019 09:17:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/5] x86/percpu: Differentiate this_cpu_{}() and __this_cpu_{}() To: Peter Zijlstra Cc: Ingo Molnar , Borislav Petkov , Thomas Gleixner , Andrew Lutomirski , Nadav Amit , Linux List Kernel Mailing , Nadav Amit 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 Wed, Feb 27, 2019 at 8:48 AM Peter Zijlstra wrote: > > On Wed, Feb 27, 2019 at 08:14:09AM -0800, Linus Torvalds wrote: > > In particular, making it "asm volatile" really is a big hammer > > approach. It's worth noting that the *other* this_cpu_xyz ops don't > > even do that. > > Right, this patch 'fixes' that :-) Yeah, but I do hate seeing these patches that randomly add double underscore versions just because the regular one is so bad. So I'd much rather improve the regular this_cpu_read() instead, and hope that we don't need to have this kind of big difference between that and the double-underscore version. I'm not convinced that the "asm volatile" is right on the _other_ ops either. You added them to cmpxchg and xadd too, and it's not obvious that they should have them. They have the "memory" clobber to order them wrt actual memory ops, why are they now "asm volatile"? So I don't really like this patch that randomly adds volatile to things, and then removes it from one special case that I don't think should have had it in the first place. It all seems pretty ad-hoc, and we already _know_ that "asm volatile" is bad. Linus