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 4A239C433E0 for ; Thu, 11 Mar 2021 13:46:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3F8564F9F for ; Thu, 11 Mar 2021 13:46:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233630AbhCKNpx (ORCPT ); Thu, 11 Mar 2021 08:45:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:34656 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233496AbhCKNpn (ORCPT ); Thu, 11 Mar 2021 08:45:43 -0500 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) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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