From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aye.elm.relay.mailchannels.net (aye.elm.relay.mailchannels.net [23.83.212.6]) by sourceware.org (Postfix) with ESMTPS id 08DC03857C4E for ; Thu, 19 Aug 2021 12:22:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 08DC03857C4E X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id AD95F182AAD; Thu, 19 Aug 2021 12:22:36 +0000 (UTC) Received: from pdx1-sub0-mail-a83.g.dreamhost.com (100-96-13-125.trex.outbound.svc.cluster.local [100.96.13.125]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 294261823D5; Thu, 19 Aug 2021 12:22:36 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a83.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.13.125 (trex/6.3.3); Thu, 19 Aug 2021 12:22:36 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Desert-Thoughtful: 50ba438c4c74e2ba_1629375756447_2271563262 X-MC-Loop-Signature: 1629375756447:2136018770 X-MC-Ingress-Time: 1629375756447 Received: from pdx1-sub0-mail-a83.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a83.g.dreamhost.com (Postfix) with ESMTP id D4BFA7F221; Thu, 19 Aug 2021 05:22:35 -0700 (PDT) Received: from [192.168.1.165] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a83.g.dreamhost.com (Postfix) with ESMTPSA id 0E5EA7F773; Thu, 19 Aug 2021 05:22:32 -0700 (PDT) Subject: Re: [PATCH v2 1/4] malloc: Add madvise support for Transparent Huge Pages To: Adhemerval Zanella , libc-alpha@sourceware.org Cc: Norbert Manthey , Guillaume Morin References: <20210818142000.128752-1-adhemerval.zanella@linaro.org> <20210818142000.128752-2-adhemerval.zanella@linaro.org> <0f4f0950-a262-ac78-55f3-f566cd63e416@sourceware.org> <704b7a6c-805e-5177-9265-c63500711d03@linaro.org> X-DH-BACKEND: pdx1-sub0-mail-a83 From: Siddhesh Poyarekar Message-ID: <7f464ebb-df71-e8c3-3033-7244bd7e9c1f@sourceware.org> Date: Thu, 19 Aug 2021 17:52:25 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <704b7a6c-805e-5177-9265-c63500711d03@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3489.1 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 12:22:40 -0000 On 8/19/21 5:30 PM, Adhemerval Zanella wrote: > I think you means 'always' and it should be handled by > __malloc_thp_mode() (which would about 'tph_pagesize' > to have a value different than 0). > > I also did not considered 'always' because I saw some results > on powerpc where even with 'always' mode issuing the madvise did > improve. I am not sure why exactly, it might be the case for > the program header that is no sufficient aligned (and with > tunable it would be). > > But maybe for 'always' it would be better to disable the > madvise() as well. Yeah we could always do more fine tuning later for architecture-specific behaviour, etc. >> Likewise for page size; this could be cached too. > > I think there is no much sense to cache since it is used once at > malloc initialization. Ahh yes, never mind this one then. Thanks, Siddhesh