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=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 058A0C4CECD for ; Fri, 20 Sep 2019 13:21:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BC0AD208C3 for ; Fri, 20 Sep 2019 13:21:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="fxPVgGWK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC0AD208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4A9876B0003; Fri, 20 Sep 2019 09:21:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4325E6B0005; Fri, 20 Sep 2019 09:21:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 320E86B0006; Fri, 20 Sep 2019 09:21:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id 0A60F6B0003 for ; Fri, 20 Sep 2019 09:21:18 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 7330DAF83 for ; Fri, 20 Sep 2019 13:21:17 +0000 (UTC) X-FDA: 75955360194.06.death31_6286e168b965f X-HE-Tag: death31_6286e168b965f X-Filterd-Recvd-Size: 3744 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Sep 2019 13:21:16 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id v38so6375689edm.7 for ; Fri, 20 Sep 2019 06:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KjJoWbq/s+cOzpzxNWtJ0sKe7VWYvgH4sW4C23WObhw=; b=fxPVgGWKizyrOEFDCOd/qx1Fk29RR580Y2UsEIfskOD2uHubzUmk+Ay8eOxuaR/uSv vY1gF357MrawvE8daiEyUwrNqC3FzGuT0TOXGR56mW8CDQUSKkDjZDAdv4TQvTH6zJ9J ZDVyLyo/01zn+lu7DYEtPfl+M9xTLDV/6+CBeKxQr0BL6UW0NjuZcLkL8o6yyr+UuZIR 0WikGrLbRc6EOmmStWm4t5Tnbi1yDCxPRLuIFbTGpv1oRS5VeRwQQw5Szfmsrc7T32+n nH7nP1QrNHpdeYKRXYTrEEfesfO20P+i7ZoD8t8xTQR+KqvIYUdnZfZFv2+SS6kStPHT 17qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KjJoWbq/s+cOzpzxNWtJ0sKe7VWYvgH4sW4C23WObhw=; b=KkzHUz7hzkcS3x8iDnsu9Q7J4IwwPWHK2PeL2VXNYz58VMKbbQ6howxtI/kJB84Fho f9tx5/ZBVdIOGe24Qa2xTjQhGAgVx1qwi91sH5uOvYLnfpEUlhZZ/UO9R1Jkj9dYwvcp YlGwvtG36m0toU4OPW+U5COsE9WsDDpe+3oJawVX6HMOX32S3PSeV1hY0v/Kord5BAS5 WBeMGpO/FrG70LinjYYVD5o3FQ0IKINn0zDnkNBx07YlxuJpnecANCDx4tN4ALjgmbwT dtJtieKr4Zvdh9vtV9eWXvPpc9yDy2hXrx2hfimB+5XR5u77dwASTPrWn1MvOwmdAJht jHgQ== X-Gm-Message-State: APjAAAUY22n47m80fEJEML3Vls/5a5g+8bmi3RkYRIWcNpOxwEVlagst +XoiQ6CGYILri4ykNZMhA3TpCw== X-Google-Smtp-Source: APXvYqxsduZAapMWzwVstniHqOLgxY6tQ8bBUkyTVS6n0fTA0P4mN1lEnIS0KNudn6P9i9Ko1H475g== X-Received: by 2002:a50:f00c:: with SMTP id r12mr22051477edl.274.1568985675740; Fri, 20 Sep 2019 06:21:15 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id a22sm226608ejs.17.2019.09.20.06.21.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Sep 2019 06:21:15 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id AB09D1006ED; Fri, 20 Sep 2019 16:21:14 +0300 (+03) Date: Fri, 20 Sep 2019 16:21:14 +0300 From: "Kirill A. Shutemov" To: Cyrill Gorcunov Cc: LKML , Linux MM , Johannes Weiner , Michal Hocko , Vladimir Davydov , Kirill Tkhai Subject: Re: [PATCH] mm, memcg: assign shrinker_map before kvfree Message-ID: <20190920132114.ofzphp53vqqjb3fs@box> References: <20190920122907.GG2507@uranus.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190920122907.GG2507@uranus.lan> User-Agent: NeoMutt/20180716 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Sep 20, 2019 at 03:29:07PM +0300, Cyrill Gorcunov wrote: > Currently there is a small gap between fetching pointer, calling > kvfree and assign its value to nil. In current callgraph it is > not a problem (since memcg_free_shrinker_maps is running from > memcg_alloc_shrinker_maps and mem_cgroup_css_free only) still > this looks suspicious and we can easily eliminate the gap at all. With this logic it will still look suspicious since you don't wait a grace period before freeing the map. -- Kirill A. Shutemov