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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 261F2C3064D for ; Tue, 2 Jul 2024 08:04:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 654FD6B0089; Tue, 2 Jul 2024 04:04:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 604B06B008A; Tue, 2 Jul 2024 04:04:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F29D6B009A; Tue, 2 Jul 2024 04:04:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2A0836B0089 for ; Tue, 2 Jul 2024 04:04:12 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C5F7B1A2027 for ; Tue, 2 Jul 2024 08:04:11 +0000 (UTC) X-FDA: 82294074702.15.3DAD04B Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf09.hostedemail.com (Postfix) with ESMTP id EC66714000E for ; Tue, 2 Jul 2024 08:04:08 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719907427; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wv8ZS9PgEummSCw53lAYCIh+X0JCoYAzQamPHiCuIIo=; b=V3sWRx4+NMPhdrG7FeB65h+PFGkeN1yGQ0bUz9jX57ZZdkg8g0TzbTzedVkkKvJ5MqpYef n8wbtZYahIYYUF9cD59/SBYoxzzZAEe2tVsE20fyXXyFa0UKBqnhzCyulI74jksiFcMjCg 1Kw3rnHl6HWA0z9UIZ13R78/D0ITBLA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719907427; a=rsa-sha256; cv=none; b=ySkZeic4xX3KiKQFQ1a5+BuQo2kSgs4cIj9IFHUeETIZTDnfTSrtqNFEY987z1mpi2hX3z 6SEFiqTn40eJCd2NWabB9tncr4hH91WFqCDA/ChRhKkVXlo+fe7v9uwqXljJ/sO0KhwPFp V7Ujfr1dor9/9JN8NEQjAdQ38myzW/Y= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WCwKv4cR7z1T4lb; Tue, 2 Jul 2024 15:59:31 +0800 (CST) Received: from kwepemd200019.china.huawei.com (unknown [7.221.188.193]) by mail.maildlp.com (Postfix) with ESMTPS id 7ABD31400C9; Tue, 2 Jul 2024 16:04:03 +0800 (CST) Received: from [10.173.127.72] (10.173.127.72) by kwepemd200019.china.huawei.com (7.221.188.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 2 Jul 2024 16:04:02 +0800 Subject: Re: [PATCH] mm/memory-failure: allow memory allocation from emergency reserves To: Andrew Morton CC: Rui Qi , , , References: <20240625022342.6158-1-qirui.001@bytedance.com> <20240702001940.43a9447a76b51a871d8dec97@linux-foundation.org> From: Miaohe Lin Message-ID: <070697f1-83f5-ff8e-dfc0-2f99c98c448c@huawei.com> Date: Tue, 2 Jul 2024 16:04:02 +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: <20240702001940.43a9447a76b51a871d8dec97@linux-foundation.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemd200019.china.huawei.com (7.221.188.193) X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: EC66714000E X-Stat-Signature: fuu6x9sk1miph1mhsh4b57f1oa94hdjc X-HE-Tag: 1719907448-145523 X-HE-Meta: U2FsdGVkX18bowkFNxW+i8kWT+2oazz61faNLf5YI+fzByXpVt5eNDqNfoGEGZOTuXKSwMSHbm6tF8TGD2/g3Cp3L+1l3nhNwGmpdHBndS2134gt5icpHQUgllKF6p0c/7i+k2HMAe/dSgn8Bumf7ax8B3XkpXijuqKnvi7LrbVyiXspMUFp3PHwYb8l8pvZaN8JdcmaJubc40J2fDNTsGmYuoltsKWpdf3C24pryQGs3QZ3VGs3qDcj8uasim+Q5RO6LS5FlZllikKC5yHlWFrcguCiovId37ch2Nef4hTw8J3eb0NglfMDIRMTOG5Mdnwxm5yin/ZLg6RelQMQfr6p11DaxoTTUrJIG/N5Wys4zMtxTVOdsd+ltqtjAiw0uIayS8UnCFUyv/ZBnwEcbkrxtVEvXuKhEglsayU5RTkxDqy8T98C6dikWV6L6JgaKAXormwhsLUHeHQ3/2MNpZr6BsvCmYIg2cLq7ifq8MJ6LLyoenIbWapd1l6IYmua2+xlMxfmAyv/E9kuYA1l53jVBFj4cnBo6H4Yr1DPQkb9vO+O963xqYOe4MZ/bU61BEL2VgC8jrywg73q5ioa61i9toGw42GQ6y+O5571HE/gqPtDpu28tMCHcoBawLPBdLm7CiXLLj4kDcnz6fj3ifnSJTo3XPinIgq1r5nH/Je9K7KlzXlxBCqy5UR4Xf1l/dbLj5WBWQNHuOoYxVEyXpH3XTaQPBS2bZLBdUb2LqNa2ED11tMMHtuHdCP1ATrf95A1+XA6Rk15O11GPEydSjkwbBo/twY8B2hfkoMlqDDiq4qzbshvaLPEgPVjwD8FCDycXHPbfU6zubWpkkPA8BsDNKTh2eM4bKqUfWRH/BD5IPFP13CxBLM5dWEkBj5NHdA2WG50hS6qoLN7XDLpbl8VifB1MQ0x41zSe9PAFfvqKMDzRjomToh76NiVVU2IVh6aYaVp3MOJWW0+NH9 cHjmZuS8 fdIIRzo6VVEZ0SdaKg7a8IbER2sCU9YFtoTlfioqFS3Kz4lTmh7rgOe2TaR98lMA23T/LbM3/b60oEjn87R9QDzMq/JNzQlnf7J4Bayj4wRszbXD97CFzjCaYWujks3KH8UrFKP8CSQRs4RtLthPAmOeBILI1PHXndVUTwtscywa+QHpvAr1hcprpkDwdAT9seGZGaDKm+PFoN4+79RUo5B9EyT9KScZNsq1Jr581gXoZLO66qhSOF4WncbDYU5cMkehORmO5fP4qdPAh+CogD8yQMw== 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: List-Subscribe: List-Unsubscribe: On 2024/7/2 15:19, Andrew Morton wrote: > On Sat, 29 Jun 2024 10:09:46 +0800 Miaohe Lin wrote: > >> On 2024/6/25 10:23, Rui Qi wrote: >>> From: Rui Qi >>> >>> we hope that memory errors can be successfully handled quickly, using >>> __GFP_MEMALLOC can help us improve the success rate of processing >> >> Comments of __GFP_MEMALLOC says: >> >> * Users of this flag have to be extremely careful to not deplete the reserve >> * completely and implement a throttling mechanism which controls the >> * consumption of the reserve based on the amount of freed memory. >> >> It seems there's no such throttling mechanism in memory_failure. >> >>> under memory pressure, because to_kill struct is freed very quickly, >>> so using __GFP_MEMALLOC will not exacerbate memory pressure for a long time, >>> and more memory will be freed after killed task exiting, which will also >> >> Tasks might not be killed even to_kill struct is allocated. >> >> ... >> >>> - raw_hwp = kmalloc(sizeof(struct raw_hwp_page), GFP_ATOMIC); >>> + raw_hwp = kmalloc(sizeof(struct raw_hwp_page), GFP_ATOMIC | __GFP_MEMALLOC); >> >> In already hardware poisoned code path, raw_hwp can be allocated to store raw page info >> without killing anything. So __GFP_MEMALLOC might not be suitable to use. >> Or am I miss something? > > Yes, I'm doubtful about this patch. I think that rather than poking at a > particular implementation, it would be helpful for us to see a complete > description of the issues which were observed, please. Let's see the > bug report and we can discuss fixes later. I agree with you, Andrew. Thanks. :) .