Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6570563pxv; Thu, 29 Jul 2021 18:52:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybFvvoq0SKhPonEe/nxGxFZ9CuHDkTttwolezdIK9Nsy/CMcGGEEV0Mnkqr9TwfQf8MHqL X-Received: by 2002:a17:907:1b22:: with SMTP id mp34mr288360ejc.408.1627609963622; Thu, 29 Jul 2021 18:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627609963; cv=none; d=google.com; s=arc-20160816; b=i0LRwyGRQyfuO+vxkG8rKEygcSbkqGFwWcSNSkLdOi5LfynjRqkU//FbLDF4QKMScg vlwTWjcBv16zhqhNk+leUW/6D8GOZwVLACNnAQ1NArigDGUOBZ71lfsGFYOgEM4QO14c 2eiv8Q7iw9r0nZPZgjwNUA3ZEx7aZ8u33oc9ChziLJ/MugmslDn5kJ9nYWajUkH5U5Ic PQRCcZyaEHVt/QH0OH+jI020pxuaCwh/3ETOhwNsAImtxrUL1h/mi3LS3QN2bDWqhwgc dRQ+o3x9insu8aitaPWao1qljXxi6I/Lpcw5ra/gBHKTwvRcv9bWDj5r51GduwBxiKcI AEpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=I7aqTotMaSwxLA9qnXjZ+rc3a9Dru/KcGtRZDDblOcM=; b=zNq5PqcttG0JmZuK65iATAuHkV/rBctzGqVyNeswI1xH28lRV1gIkil2c5nDBTwxyL 7fAm2ED9joynMA8HhVxwdZX3nXITWYVJnZkJYMCGdn2XV0mjjUV6ZSqfDx5AqtXyeMYn wK4M5gdp2VR7QPK7Nv7oWJjkFS0maZygVR6nsYGeLWuHXB2q9vhRS+pfsC1wfkkNsYhO pWdgytlGr/m9h/EPdN35E8UMaivywR9xa5FX6k8KhJYGlvzO8jXCGRJAiedgSAU4HRFB nveDSUuAvqv0Cze8MnDLiIoc9DXYfmgPJ+o+qXEEGyVO+2FjPH+08gyiaQ1r3GzMHI0Q ySpw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 24si241462edv.154.2021.07.29.18.52.20; Thu, 29 Jul 2021 18:52:43 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234576AbhG3BuV (ORCPT + 99 others); Thu, 29 Jul 2021 21:50:21 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:13213 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbhG3BuU (ORCPT ); Thu, 29 Jul 2021 21:50:20 -0400 Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4GbVYr64VTz1CPJN; Fri, 30 Jul 2021 09:44:16 +0800 (CST) Received: from [10.174.178.209] (10.174.178.209) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 30 Jul 2021 09:50:14 +0800 Subject: Re: [PATCH 4/5] mm, memcg: avoid possible NULL pointer dereferencing in mem_cgroup_init() To: Matthew Wilcox CC: , , , , , , , , , , , References: <20210729125755.16871-1-linmiaohe@huawei.com> <20210729125755.16871-5-linmiaohe@huawei.com> From: Miaohe Lin Message-ID: Date: Fri, 30 Jul 2021 09:50:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.209] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/7/29 21:52, Matthew Wilcox wrote: > On Thu, Jul 29, 2021 at 08:57:54PM +0800, Miaohe Lin wrote: >> rtpn might be NULL in very rare case. We have better to check it before >> dereferencing it. Since memcg can live with NULL rb_tree_per_node in >> soft_limit_tree, warn this case and continue. > > Why would we need to warn? the GFP flags don't contain NOWARN, so > we already know an allocation failed. I see. Will remove it. Many thanks! > . >