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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 2FE71C433DB for ; Thu, 11 Mar 2021 13:45:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8640164F9F for ; Thu, 11 Mar 2021 13:45:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8640164F9F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CF8F68D02BE; Thu, 11 Mar 2021 08:45:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CCFC98D02B2; Thu, 11 Mar 2021 08:45:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B842E8D02BE; Thu, 11 Mar 2021 08:45:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id 9DE898D02B2 for ; Thu, 11 Mar 2021 08:45:43 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 657B9180ACEEC for ; Thu, 11 Mar 2021 13:45:43 +0000 (UTC) X-FDA: 77907716166.12.FC85EAC Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf19.hostedemail.com (Postfix) with ESMTP id EBD0990009E9 for ; Thu, 11 Mar 2021 13:45:40 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 67E80AB8C; Thu, 11 Mar 2021 13:45:41 +0000 (UTC) Date: Thu, 11 Mar 2021 14:45:35 +0100 From: Oscar Salvador To: Michal Hocko Cc: Muchun Song , Jonathan Corbet , Mike Kravetz , Thomas Gleixner , Ingo Molnar , bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , Alexander Viro , Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , Matthew Wilcox , "Song Bao Hua (Barry Song)" , David Hildenbrand , HORIGUCHI =?utf-8?B?TkFPWUEo5aCA5Y+jIOebtOS5nyk=?= , Joao Martins , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel , Miaohe Lin , Chen Huang , Bodeddula Balasubramaniam Subject: Re: [External] Re: [PATCH v18 9/9] mm: hugetlb: optimize the code with the help of the compiler Message-ID: <20210311134531.GA24797@linux> References: <20210308102807.59745-1-songmuchun@bytedance.com> <20210308102807.59745-10-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Stat-Signature: ii3moy19hug6bcn79zc9zxnfykiymuus X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: EBD0990009E9 Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf19; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1615470340-853592 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 Thu, Mar 11, 2021 at 01:16:37PM +0100, Michal Hocko wrote: > On Thu 11-03-21 18:00:09, Muchun Song wrote: > [...] > > Sorry. I am confused why you disagree with this change. > > It does not bring any disadvantages. > > Because it is adding a code which is not really necessary and which will > have to be maintained. Think of future changes which would need to grow > more of these. Hugetlb code paths shouldn't really think about size of > the struct page. I have to confess that when I looked at the patch I found it nice in the way that wipes out almost all clode dealing with vmemmap when sizeof(struct page) != power_of_2, and I was convinced by the fact that only two places required the change. So all in all it did not look like much churn, and not __that__ hard to maintain. But I did not think in the case where this trick needs to be spread in more places if the code changes over time. So I agree that although it gets rid of a lot of code, it would seldomly pay off as not many configuration out there are running on !power_of_2, and hugetlb is already tricky enough. -- Oscar Salvador SUSE L3