From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDED1C4361B for ; Tue, 15 Dec 2020 12:58:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1752522509 for ; Tue, 15 Dec 2020 12:58:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1752522509 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ya.ru Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 185A76B006C; Tue, 15 Dec 2020 07:58:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 10F276B006E; Tue, 15 Dec 2020 07:58:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F18686B0070; Tue, 15 Dec 2020 07:58:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id D779F6B006C for ; Tue, 15 Dec 2020 07:58:11 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 933E01DEA for ; Tue, 15 Dec 2020 12:58:11 +0000 (UTC) X-FDA: 77595519582.30.sort88_27181dc27423 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 65768180B3C8B for ; Tue, 15 Dec 2020 12:58:11 +0000 (UTC) X-HE-Tag: sort88_27181dc27423 X-Filterd-Recvd-Size: 3545 Received: from forward500o.mail.yandex.net (forward500o.mail.yandex.net [37.140.190.195]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Dec 2020 12:58:10 +0000 (UTC) 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-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000509, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 15.12.2020, 15:40, "Johannes Weiner" : > On Mon, Dec 14, 2020 at 02:37:16PM -0800, Yang Shi wrote: >> =C2=A0The shrink_slab_memcg() races with mem_cgroup_css_online(). A vi= sibility of CSS_ONLINE flag >> =C2=A0in shrink_slab_memcg()->mem_cgroup_online() does not guarantee t= hat we will see >> =C2=A0memcg->nodeinfo[nid]->shrinker_maps !=3D NULL. This may occur be= cause of processor reordering >> =C2=A0on !x86. >> >> =C2=A0This seems like the below case: >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= CPU A CPU B >> =C2=A0store shrinker_map load CSS_ONLINE >> =C2=A0store CSS_ONLINE load shrinker_map >> >> =C2=A0So the memory ordering could be guaranteed by smp_wmb()/smp_rmb(= ) pair. >> >> =C2=A0The memory barriers pair will guarantee the ordering between shr= inker_deferred and CSS_ONLINE >> =C2=A0for the following patches as well. >> >> =C2=A0Signed-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.