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 AF901ECAAA1 for ; Fri, 9 Sep 2022 22:25:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF9728D0003; Fri, 9 Sep 2022 18:25:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA9CB8D0002; Fri, 9 Sep 2022 18:25:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A71438D0003; Fri, 9 Sep 2022 18:25:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 965968D0002 for ; Fri, 9 Sep 2022 18:25:44 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 60E7A1402C2 for ; Fri, 9 Sep 2022 22:25:44 +0000 (UTC) X-FDA: 79893980208.02.66554E2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id E64CF140098 for ; Fri, 9 Sep 2022 22:25:43 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3E7076206A; Fri, 9 Sep 2022 22:25:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D1D4C433C1; Fri, 9 Sep 2022 22:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1662762342; bh=YR24SjL9hD2IUBf0unQ9ghgo4+TqmWl8eCQbDGfdy0c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cmPSZZQGmZIHYMh3UVP1BSAttpVww8hBDv0Xxkqy4s6OJEh1v/1ntV14BZ4564ZfK k/UICTgq1JCnq4pbhYdhVw38ZKKS26hDk+L5DHJbD9XxsVAivL0553083mhh+ET7E5 1Quzm78SaQI75gqaez6hBfoAIsMxX5DPo/D2Qf1E= Date: Fri, 9 Sep 2022 15:25:41 -0700 From: Andrew Morton To: Liu Shixin Cc: "Kirill A . Shutemov" , Andrea Arcangeli , , , Kefeng Wang Subject: Re: [PATCH v3] mm/huge_memory: prevent THP_ZERO_PAGE_ALLOC increased twice Message-Id: <20220909152541.dff88a98938258f09c46dcd0@linux-foundation.org> In-Reply-To: <20220909021653.3371879-1-liushixin2@huawei.com> References: <20220909021653.3371879-1-liushixin2@huawei.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662762344; 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:dkim-signature; bh=omvRh6MYGDNtuOIoegj2gIHWEiKNNgQBn1xM0hBR954=; b=iDYMtWCOM8cZvbvM+jvkNbJ/wQ9TXpz4SHsP2YBrrdtMH0n106ZdmwaTqwa6bfMWKLSMNT TgLHSS3uUUCdyZEzvjA3iJmI77vktIM2LkNp/H4M2ty7HFV1oIBi4u2pyxPZSRwmJsveyd uSSWvNb0wr4jTx+D3/1ftPHdtQRMPzs= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=cmPSZZQG; spf=pass (imf09.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662762344; a=rsa-sha256; cv=none; b=JGz4gtAFCNFLyCZKua5NEe98Ro62qTc1BJR107ZYsWyQbpkJ4lcEHRJVJ0M4bDq0jC1dXD zCweZ4Ia9YiobkzeuaQQHR5qDTw96IYg5M7ybfe56D/vyFAFm5tn51XrQrrA1vrhluIwvm lNMHhfcuyLTREGymtwmwg5fw2su+36o= X-Rspam-User: Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=cmPSZZQG; spf=pass (imf09.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam06 X-Stat-Signature: i7cymafi84xcsosjamsgphfmxauqoz6r X-Rspamd-Queue-Id: E64CF140098 X-HE-Tag: 1662762343-978179 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 Sep 2022 10:16:53 +0800 Liu Shixin wrote: > Since user who read THP_ZERO_PAGE_ALLOC may be more concerned about the > huge zero pages that are really allocated using for thp and can indicated > the times of calling huge_zero_page_shrinker. It is misleading to increase > twice if two threads call get_huge_zero_page concurrently. Don't increase > the value if the huge page is not really used. > I cant say I really understand the point about huge_zero_page_shrinker(), so I propose this changelog: : A user who reads THP_ZERO_PAGE_ALLOC may be more concerned about the huge : zero pages that are really allocated for thp. It is misleading to : increase THP_ZERO_PAGE_ALLOC twice if two threads call get_huge_zero_page : concurrently. Don't increase the value if the huge page is not really : used. The patch makes sense to me. What do others think?