Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7192472ybi; Wed, 5 Jun 2019 12:54:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEc2nNWdrAcAVO9TJUUjVwIScghGcWB23NZu+uvXuegmoWOJpcwuy5wRWGZUaqSLjccOJl X-Received: by 2002:a63:6841:: with SMTP id d62mr567635pgc.17.1559764449843; Wed, 05 Jun 2019 12:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559764449; cv=none; d=google.com; s=arc-20160816; b=d8c8j044uRDZ3BdaeNOc2Tfbo+CStUMxE2GLBF0sDIAgXW5QfnNeqotEr1Kd4jtAM+ vstE68/ZkC3xjzvo/wQ9mVvsSYF3Ri6uIu5cgT9bL1RLSg3jJcBFHWnZ0R4zPxCYo2vt +MEmqiI0hYZHbl0Dg7E3pEvGw/hfmYHcMM9L7u1RZebvfUs7WojYGxydx5AGbOPCZv+U pEJgq1Gd+J6p+H3PBlwKIlzH4DWAZo3dUGyqTr6IgsQzH++oByH1KDU9EtYgDikGbCqB 5zvkWfcLo4/w47GrXyyAiIUiAqRjY037E/AWJvmDYmnKKldrwS8BhEN68FflxCm5DVrV wdig== 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=ADSrVTY729P8giks2VI3lL/ewrVA0y+ziy53/CJHjbI=; b=0wOawAU6EHChnJsCRr8mDjfCNAcxgoxnbUxOiCHHSMXyF4BwQ3MFGZZ3H1DaKh3F9N bpIT6dxlEu7d9y9m9uobbKTKpq71HM61a4aaLskkbWnY9ZKacl7KVKQwXWB1rZNZGW87 AmR1Bi6pr/i55g/LHThaP5e8/0Jh0Cl/fYaNd9f7D23KYFhHRul8W78fQD7QYMAjOOuI /Wbq+D4RsYvuNq0HNvf2O1K8aQtD5H6qZG+oCdZj5KZmi8z1c7zxLUK82ECTZ7Tofb5w nUa4mgrSTkydeU8aMGeqWgcNdn1m6x1iQo3eI9DHTyat6EtjUpJhmCrOdwK8CSP8kxr3 QV6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=l3SHbq+t; 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 y1si33859910pfb.264.2019.06.05.12.53.52; Wed, 05 Jun 2019 12:54:09 -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=l3SHbq+t; 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 S1726528AbfFETv1 (ORCPT + 99 others); Wed, 5 Jun 2019 15:51:27 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:41907 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbfFETv0 (ORCPT ); Wed, 5 Jun 2019 15:51:26 -0400 Received: by mail-yb1-f194.google.com with SMTP id d2so26117ybh.8 for ; Wed, 05 Jun 2019 12:51:26 -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=ADSrVTY729P8giks2VI3lL/ewrVA0y+ziy53/CJHjbI=; b=l3SHbq+tQMcR8JiOwkKI+rqmX8UZZye9PTtYe2D5QDQJbkEw4tn4YzYjfj1Avcsc8J cRSil6+QYDOrKQcFibXBl8KHBvqgfc+1gWOKhOe5AQUjTBRcaA3c9aZHM9gXxsy42Uaj XaKe/llBw2BCOk7t9sYKNJWXw59+a0I7dELeuw9kQpYWeGkMxRiRyXAcTSC6Y+L4A1hI 8NfTciR75XJzP+w3pQnIvURLV7LJhtCB6aKw4xvZuKpyq0I/nCGRAMJWlVW7ec6CpZJy ACUbqKujEVikDTF5Sng3n0OT3pwVrcF9Was5/ZEXf62lg8i+p7yOdy49gg/QBSLKQy/T wMSA== 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=ADSrVTY729P8giks2VI3lL/ewrVA0y+ziy53/CJHjbI=; b=prA1aXO7JT9yWOAkxSA4lTVJPrBH29RkF49SFlY+2Tn+b/jkS5g0kUI0es3LXWNhbc 1YFKLJH76SaefETwFxSjkAtyWh00u8EycwZ8J4H1qp7KSCUi6/ub8aFKjEvTzLQoG7sJ en9uPPkewzYXZ8vredc6n3oxbMgLbpfsJLTKhw6TnkVrHkoa7lOVOdNA++/0pkzYVm83 hYQYJ+8kUdX++YDmquNwZBDuGQXZsmjvgCHuKlK77mBGX07QvYDr06IbYg7YjiY8fXjY JMeE/+2eBXDtnmYJH+gCAvF3qdXngow+8YhFImbefDjgZVBEtEnUe+4aFKDrSR2m3e0a Bnlg== X-Gm-Message-State: APjAAAUsWenv/XRkfVK7+6jqIgc+HeXjyykz418UkNfYnSfHphIQNdQQ B61rlpH9g+hrGFkuXo79RDaeqCJzNnKDBWe5Ux2Gpg== X-Received: by 2002:a25:7c05:: with SMTP id x5mr19854493ybc.358.1559764285452; Wed, 05 Jun 2019 12:51:25 -0700 (PDT) MIME-Version: 1.0 References: <20190605024454.1393507-1-guro@fb.com> <20190605024454.1393507-2-guro@fb.com> <20190605171355.GA10098@tower.DHCP.thefacebook.com> In-Reply-To: <20190605171355.GA10098@tower.DHCP.thefacebook.com> From: Shakeel Butt Date: Wed, 5 Jun 2019 12:51:14 -0700 Message-ID: Subject: Re: [PATCH v6 01/10] mm: add missing smp read barrier on getting memcg kmem_cache pointer To: Roman Gushchin Cc: Andrew Morton , Linux MM , LKML , Kernel Team , Johannes Weiner , Vladimir Davydov , Waiman Long 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, Jun 5, 2019 at 10:14 AM Roman Gushchin wrote: > > On Tue, Jun 04, 2019 at 09:35:02PM -0700, Shakeel Butt wrote: > > On Tue, Jun 4, 2019 at 7:45 PM Roman Gushchin wrote: > > > > > > Johannes noticed that reading the memcg kmem_cache pointer in > > > cache_from_memcg_idx() is performed using READ_ONCE() macro, > > > which doesn't implement a SMP barrier, which is required > > > by the logic. > > > > > > Add a proper smp_rmb() to be paired with smp_wmb() in > > > memcg_create_kmem_cache(). > > > > > > The same applies to memcg_create_kmem_cache() itself, > > > which reads the same value without barriers and READ_ONCE(). > > > > > > Suggested-by: Johannes Weiner > > > Signed-off-by: Roman Gushchin > > > > Reviewed-by: Shakeel Butt > > > > This seems like independent to the series. Shouldn't this be Cc'ed stable? > > It is independent, but let's keep it here to avoid merge conflicts. > > It has been so for a long time, and nobody complained, so I'm not sure > if we really need a stable backport. Do you have a different opinion? > Nah, it's fine as it is.