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=-12.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham 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 58C15C433DB for ; Fri, 15 Jan 2021 08:47:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 084752313E for ; Fri, 15 Jan 2021 08:47:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 084752313E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8CDC28D0140; Fri, 15 Jan 2021 03:47:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 87CBF8D0023; Fri, 15 Jan 2021 03:47:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71DC98D0140; Fri, 15 Jan 2021 03:47:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id 555748D0023 for ; Fri, 15 Jan 2021 03:47:51 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 22F13824556B for ; Fri, 15 Jan 2021 08:47:51 +0000 (UTC) X-FDA: 77707381542.25.noise72_391197a2752e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 05FAF1804E3BE for ; Fri, 15 Jan 2021 08:47:51 +0000 (UTC) X-HE-Tag: noise72_391197a2752e X-Filterd-Recvd-Size: 3588 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Fri, 15 Jan 2021 08:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610700470; h=from:from: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=7+3aFpRnpA/Vn6XuyDfHSEJMgBWrcsXLf+cf+V33kME=; b=DnWYKm6YzfIM6Rd8XOhAYMMdB1h+I9DUU6aTpKWymuPXHpfRdJGEk99ZjKwm49cDaz1bWJ fmz5ZOkh6KUzd3HdDCQEbVfTVcMs0HbdZStBCo3H3aCplJoAt/Due/0ZYuyDGNszhQkU2U +UwX99lfpv4Kq8a6ayCxXk/yB/psJXs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-o8zcdaJIPFejOLZrNvxqZQ-1; Fri, 15 Jan 2021 03:47:48 -0500 X-MC-Unique: o8zcdaJIPFejOLZrNvxqZQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB33D1DDE0; Fri, 15 Jan 2021 08:47:46 +0000 (UTC) Received: from [10.36.112.11] (ovpn-112-11.ams2.redhat.com [10.36.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC5FD60C6B; Fri, 15 Jan 2021 08:47:45 +0000 (UTC) Subject: Re: [PATCH] mm/hugetlb: avoid unnecessary hugetlb_acct_memory() call To: Miaohe Lin , Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton References: <20210114113140.23069-1-linmiaohe@huawei.com> <853d6aa4-b84c-7ac2-00d4-402893fcf6b3@redhat.com> <9841241e-eb8f-9b49-8d2d-d84effda8ba4@huawei.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Fri, 15 Jan 2021 09:47:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <9841241e-eb8f-9b49-8d2d-d84effda8ba4@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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 15.01.21 03:04, Miaohe Lin wrote: > Hi: > > On 2021/1/15 3:16, Mike Kravetz wrote: >> On 1/14/21 4:32 AM, David Hildenbrand wrote: >>> On 14.01.21 12:31, Miaohe Lin wrote: >>>> When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except holding >>>> and releasing hugetlb_lock. >>> >>> So, what's the deal then? Adding more code? >>> >>> If this is a performance improvement, we should spell it out. Otherwise >>> I don't see a real benefit of this patch. >>> >> >> Thanks for finding/noticing this. >> >> As David points out, the commit message should state that this is a >> performance improvement. Mention that such a change avoids an unnecessary >> hugetlb_lock lock/unlock cycle. You can also mention that this unnecessary >> lock cycle is happening on 'most' hugetlb munmap operations. >> > > My bad. I should spell this out explicitly. Many thanks for both of you. With the "lock cycle is happening on 'most' hugetlb munmap operations" part added Reviewed-by: David Hildenbrand Thanks! -- Thanks, David / dhildenb