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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 B0490C33CB3 for ; Thu, 16 Jan 2020 19:23:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 562DF207E0 for ; Thu, 16 Jan 2020 19:23:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="OvJbTf0R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 562DF207E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C17208E008C; Thu, 16 Jan 2020 14:23:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B78D58E0089; Thu, 16 Jan 2020 14:23:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F1B58E008C; Thu, 16 Jan 2020 14:23:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0003.hostedemail.com [216.40.44.3]) by kanga.kvack.org (Postfix) with ESMTP id 84A688E0089 for ; Thu, 16 Jan 2020 14:23:01 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 38ACC180AD804 for ; Thu, 16 Jan 2020 19:23:01 +0000 (UTC) X-FDA: 76384470162.20.table68_547b33b8c5640 X-HE-Tag: table68_547b33b8c5640 X-Filterd-Recvd-Size: 6623 Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Jan 2020 19:23:00 +0000 (UTC) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00GJHx3x079002; Thu, 16 Jan 2020 19:22:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=0xpT0Zml5wBdexQLU9AtlDyVqUbvvSJBXTj96buRMtA=; b=OvJbTf0RysxCf03w3C4SANt9wwRUE8Q1sPbJ/utSyui2a2KquyaAI4LqgEPHrHk/FdON /vX5Pgjm8yj7BWMnHlrlLQFFiMVffr22AjXJFTk361y4thXo7hClNrky7M+q6RzJHEK7 OXGOTb0BiEkBfXy6AUO2aZQS6EHvzOjhQs2UNJtK0XVxGqJmkhsBxIMymXeAHlftESC1 9lFeZtPaNG6ZpwahMD+gIzTJatOOVT/rlFVnD0e2mVthv0OEOXDvWWyIlgQts0oG/CPv TDPYbFfPzMSKCWOdueipXFTCPbPU/FOwpItRFzPqz6zUdW5HpAtBjFk+5CjqBlfJVsTx Gw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2xf73u4gvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2020 19:22:55 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00GJJ0gw120675; Thu, 16 Jan 2020 19:22:54 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2xj61n3ypf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2020 19:22:54 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 00GJMqwf009509; Thu, 16 Jan 2020 19:22:53 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Jan 2020 11:22:52 -0800 Subject: Re: [PATCH 2/2] mm/mempolicy: Skip walking HUGETLB vma if MPOL_MF_STRICT is specified alone To: Michal Hocko Cc: Li Xinhai , "linux-mm@kvack.org" , akpm , "yang.shi" , n-horiguchi References: <1578993378-10860-1-git-send-email-lixinhai.lxh@gmail.com> <1578993378-10860-2-git-send-email-lixinhai.lxh@gmail.com> <2020011422092314671410@gmail.com> <20200116075933.GN19428@dhcp22.suse.cz> From: Mike Kravetz Message-ID: Date: Thu, 16 Jan 2020 11:22:51 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200116075933.GN19428@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9502 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=840 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001160154 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9502 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=872 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001160154 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 1/15/20 11:59 PM, Michal Hocko wrote: > On Wed 15-01-20 13:07:17, Mike Kravetz wrote: >> What should we do? >> ================== >> 1) Nothing more than optimizations by Li Xinhai. Behavior that could be >> seen as conflicting with man page has existed since v3.12 and I am >> not aware of any complaints. >> 2) In addition to optimizations by Li Xinhai, modify code to truly ignore >> MPOL_MF_STRICT for huge page mappings. This would be fairly easy to do >> after a failure of migrate_pages(). We could simply traverse the list >> of pages that were not migrated looking for any non-hugetlb page. >> 3) Remove the statement "MPOL_MF_STRICT is ignored on huge page mappings." >> and modify code accordingly. >> >> My suggestion would be for 1 or 2. Thoughts? > > And why do we exactly need to do anything at all? There is an > inconsistency that has been there for years without anybody noticing. > NUMA API is a mess on its own and unfixable at this stage, there will > always be some corner cases. If there is no real workload hitting this > incosistency and suffering, I would rather not touch this at all. > Unless the change would clean up the code or make it more maintainable. That is a very valid point. Sometimes we as developers get focused on the actual code changes and fail to ask the question "does this really need to be changed?" or "what value do the code changes provide?". Li Xinhai came up with two optimizations in how the mbind code deals with hugetlb pages. This 'sub-optimal' code has existed for more than 6 years. Unless I am mistaken, nobody has actually complained or noticed this behavior. I believe Li Xinhai noticed this inefficient code via code inspection. Of course, based on what we know today one could write a test program to show the inefficient behavior. However, no real users have noticed this during the past 6 years. The proposed code changes are fairly simple. However, I would not say that they clean up the code or make it more maintainable. They essentially add or modify two checks to bail out early for hugetlb vma's if the flag which is documented to not apply to hugetlb pages (MPOL_MF_STRICT) is specified. If one is trying to follow the entire mbind code path for hugetlb pages, these patches will make that easier follow/understand. That is simply because one can ignore downstream code/functionality. Based on Michal's criteria above, I now believe the code changes should not be made. Yes, they are fairly simple. However, even simple changes have the potential to break something (build breakage with v1 of patch). We should leave this code as is unless issues are reported by users. -- Mike Kravetz