Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3354684pxu; Tue, 15 Dec 2020 05:13:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5jY3NsmkClrLxIl62o2arI89bW0uzlER4EvOWjOeXCx1rDos/XmGF8yV1zFM6MXu2h1Uf X-Received: by 2002:a17:906:d784:: with SMTP id pj4mr26124902ejb.360.1608037992366; Tue, 15 Dec 2020 05:13:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608037992; cv=none; d=google.com; s=arc-20160816; b=KgaMFEW56K9Rw0iKBsISz3ZMOaL8Av8AWH9ENFOMRZWY6OR1xsriAha517Pi2AYadW SKuNePBnH/0TW2KhDk+7Q7Oo48OjZB8bhR9d8Jm88QQuP1Hegxwhoqeb06+0bvusSULJ sesACFkGHPGCb2rlRFK272UXc3gd6Ryj8+OTg9LhQvB3RBmx5sS20ECtskq9VzjwCAWf DEw8MyKzjPJkhhNxRwGvX8jcBlCQ+76del4L+YftpWh8Tarl4SpkX9qEszpd4EC1cwNQ FcVwaAWNzNugTA/H56mkn+Pmy86U+7A5ZU2V7lfTaRI5uEv5mM3TZRloKboXHzD9zJui Qoig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:date :mime-version:subject:references:in-reply-to:cc:to:envelope-from :from:dkim-signature; bh=8mB7d8IwTKcg20kv8S+ADbckzXnrxLNOYv35fykpx+E=; b=iiP2FeBB8cX5s2zxYJjnZhoRCBQrrtjClSe6SDNd3l1aEgdfX/c0SBpjDlHoRR5gKf 1FpjS+pFbr2XcejAZ7JsRJDve+Ysy5dHCqhUh0EBZfwcsGNVekUFZgq0hpbdSE9xw0nI Z00cx6VZdii6xZnpjX1BkXiBLaZJILZQqRCMFduze1R3V2qPxMPNPRFdsJQyF5VE24y4 uFi+2HGWIkItQe/wDCOfsUAtUye+PlizJKPqyTNxH1aOOo2aUcJvH8N0g0zsqG8+5sNV 3cR2znQE673dvWowcFXuP2qqhWh6WoUeKz4FJpH4vFHMLlxT89ZWEqYzpUvpLG6eSahz 7u3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ya.ru header.s=mail header.b=CP1EHMe9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ya.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si790796eja.285.2020.12.15.05.12.48; Tue, 15 Dec 2020 05:13:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ya.ru header.s=mail header.b=CP1EHMe9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ya.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728450AbgLONHe (ORCPT + 99 others); Tue, 15 Dec 2020 08:07:34 -0500 Received: from forward500o.mail.yandex.net ([37.140.190.195]:43841 "EHLO forward500o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbgLONHK (ORCPT ); Tue, 15 Dec 2020 08:07:10 -0500 X-Greylist: delayed 490 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Dec 2020 08:07:08 EST Received: from mxback7q.mail.yandex.net (mxback7q.mail.yandex.net [IPv6:2a02:6b8:c0e:41:0:640:cbbf:d618]) by forward500o.mail.yandex.net (Yandex) with ESMTP id 8CFF660612; Tue, 15 Dec 2020 15:58:07 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback7q.mail.yandex.net (mxback/Yandex) with ESMTP id OcKYYexCGh-w6IWopKl; Tue, 15 Dec 2020 15:58:06 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1608037086; bh=8mB7d8IwTKcg20kv8S+ADbckzXnrxLNOYv35fykpx+E=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=CP1EHMe9CaMM27YRVKyKhDzygETPxbGt99x1ne+emd9NJVmVpP76W1ke+d6szxK+9 I4ZAuo/WD34hLysHOug04qr2j2pIJVLsqMnqOSooar2B8UZJ9D93OzZ8RQK4pVXFfr 5Ms0lDMBQu8OeKdBVuzVec8fvSvK0HE1q58pJWbc= Authentication-Results: mxback7q.mail.yandex.net; dkim=pass header.i=@ya.ru Received: by vla5-5336eea6ea62.qloud-c.yandex.net with HTTP; Tue, 15 Dec 2020 15:58:06 +0300 From: Kirill Tkhai Envelope-From: tkhai@yandex.ru To: Johannes Weiner , Yang Shi Cc: "guro@fb.com" , "ktkhai@virtuozzo.com" , "shakeelb@google.com" , "david@fromorbit.com" , "mhocko@suse.com" , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" In-Reply-To: <20201215123802.GA379720@cmpxchg.org> References: <20201214223722.232537-1-shy828301@gmail.com> <20201214223722.232537-4-shy828301@gmail.com> <20201215123802.GA379720@cmpxchg.org> Subject: Re: [v2 PATCH 3/9] mm: vmscan: guarantee shrinker_slab_memcg() sees valid shrinker_maps for online memcg MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 15 Dec 2020 15:58:06 +0300 Message-Id: <1874151608036985@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 15.12.2020, 15:40, "Johannes Weiner" : > On Mon, Dec 14, 2020 at 02:37:16PM -0800, Yang Shi wrote: >>  The shrink_slab_memcg() races with mem_cgroup_css_online(). A visibility of CSS_ONLINE flag >>  in shrink_slab_memcg()->mem_cgroup_online() does not guarantee that we will see >>  memcg->nodeinfo[nid]->shrinker_maps != NULL. This may occur because of processor reordering >>  on !x86. >> >>  This seems like the below case: >> >>             CPU A CPU B >>  store shrinker_map load CSS_ONLINE >>  store CSS_ONLINE load shrinker_map >> >>  So the memory ordering could be guaranteed by smp_wmb()/smp_rmb() pair. >> >>  The memory barriers pair will guarantee the ordering between shrinker_deferred and CSS_ONLINE >>  for the following patches as well. >> >>  Signed-off-by: Yang Shi > > As per previous feedback, please move the misplaced shrinker > allocation callback from .css_online to .css_alloc. This will get you > the necessary ordering guarantees from the cgroup core code. Can you read my emails from ktkhai@virtuozzo.com? I've already answered on this question here: https://lkml.org/lkml/2020/12/10/726 Check your spam folder, and add my address to allow-list if so.