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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 78659C433ED for ; Fri, 9 Apr 2021 05:04:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0E09F61181 for ; Fri, 9 Apr 2021 05:04:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E09F61181 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8D08A6B006E; Fri, 9 Apr 2021 01:04:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 835206B0070; Fri, 9 Apr 2021 01:04:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D3786B0071; Fri, 9 Apr 2021 01:04:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id 4FFFF6B006E for ; Fri, 9 Apr 2021 01:04:55 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 140188248047 for ; Fri, 9 Apr 2021 05:04:55 +0000 (UTC) X-FDA: 78011638950.21.A2CD6B9 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf10.hostedemail.com (Postfix) with ESMTP id 26A4140002C2 for ; Fri, 9 Apr 2021 05:04:51 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id B70CC610A2; Fri, 9 Apr 2021 05:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1617944693; bh=7SOpsa0o4t1jaPRNexNfeE1nLPrakeTw29gTONj7AJ0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FJ5fT3Q56hZnzLI8EgfR7InX0tVvMv4PMvTINhEZUDMfJQ+vqk4HTOZpqZ8xx2BDK XsrgJDSQU/GpmstHL8p59p2Sf3PvhFAEufhRDWilOUOAYGYPhKFcuGnRvngb7Gm/eH daUpKXDNjp+J79zfk2ZSBolDgIhCy3tBRYlvPI04= Date: Thu, 8 Apr 2021 22:04:53 -0700 From: Andrew Morton To: Miaohe Lin Cc: Mike Kravetz , , , , Subject: Re: [PATCH 4/4] mm/hugeltb: handle the error case in hugetlb_fix_reserve_counts() Message-Id: <20210408220453.f95942bf20baadd8dbbc1488@linux-foundation.org> In-Reply-To: References: <20210402093249.25137-1-linmiaohe@huawei.com> <20210402093249.25137-5-linmiaohe@huawei.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: z3ggrwhj1hwkhsez7hbqtih5xi6p3q9b X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 26A4140002C2 Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf10; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617944691-537853 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, 9 Apr 2021 11:17:49 +0800 Miaohe Lin wrote: > On 2021/4/9 7:25, Mike Kravetz wrote: > > On 4/2/21 2:32 AM, Miaohe Lin wrote: > >> A rare out of memory error would prevent removal of the reserve map region > >> for a page. hugetlb_fix_reserve_counts() handles this rare case to avoid > >> dangling with incorrect counts. Unfortunately, hugepage_subpool_get_pages > >> and hugetlb_acct_memory could possibly fail too. We should correctly handle > >> these cases. > > > > Yes, this is a potential issue. > > > > The 'good news' is that hugetlb_fix_reserve_counts() is unlikely to ever > > be called. To do so would imply we could not allocate a region entry > > which is only 6 words in size. We also keep a 'cache' of entries so we > > may not even need to allocate. > > > > But, as mentioned it is a potential issue. > > Yes, a potential *theoretical* issue. > > > > >> Fixes: b5cec28d36f5 ("hugetlbfs: truncate_hugepages() takes a range of pages") > > > > This is likely going to make this get picked by by stable releases. > > That is unfortunate as mentioned above this is mostly theoretical. > > > > I will drop this. This does not worth backport. > -stable have been asked not to backport MM patches unless MM patches include "cc:stable". ie, no making our backporting decisions for us, please.