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.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 0BB2CC352A3 for ; Mon, 10 Feb 2020 17:19:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C11C720715 for ; Mon, 10 Feb 2020 17:19:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="u0JG65AP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C11C720715 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 560C56B0136; Mon, 10 Feb 2020 12:19:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 512046B0137; Mon, 10 Feb 2020 12:19:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4018B6B0138; Mon, 10 Feb 2020 12:19:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 2877B6B0136 for ; Mon, 10 Feb 2020 12:19:58 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D28B2282B for ; Mon, 10 Feb 2020 17:19:57 +0000 (UTC) X-FDA: 76474880034.13.park42_1cb5d9d04c154 X-HE-Tag: park42_1cb5d9d04c154 X-Filterd-Recvd-Size: 5997 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Mon, 10 Feb 2020 17:19:57 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01AHII6G056874; Mon, 10 Feb 2020 17:19:52 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-2020-01-29; bh=dyAcogwnHcfNE909nAOukweApWhJHWcagckpN+ztZU4=; b=u0JG65AP/HvGus8Kw7G9pSj3jzjX07fEjnjNju0J2Or/opPZBEWytSKEsH8xCrIXKEjH ZuTD35PSkWhgYOSuYPkHX4QairllQqxqciO8DS8AYdAMqvapIfNrcG9uWwKOSvqiS0Bm JqsMn6k+tw/UhUmNXpd4htJCTzT7h8bNVUqvRx7ooGwAVByJ8Z9b76goGR8xkfHjjmt6 06nE/9K3U+Jhm5VsOLw+DUr67klv3TD3hHmMa3Y2BNHBImZ4z/jKp1w5d48h/p9WJJoU ISN5RcKo2QM9sVDsn37rMS/UcR9mxz7HOljBAwzq9pYkNZ0lM+pUErr563A3NGE+KeB7 oA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2y2k87x0gj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Feb 2020 17:19:52 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01AHIMNX195997; Mon, 10 Feb 2020 17:19:51 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2y26sk1sba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Feb 2020 17:19:51 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 01AHJnh5003779; Mon, 10 Feb 2020 17:19:49 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 10 Feb 2020 09:19:49 -0800 Subject: Re: [PATCH] mm/mempolicy: support MPOL_MF_STRICT for huge page mapping To: Naoya Horiguchi , Li Xinhai , linux-mm@kvack.org Cc: akpm@linux-foundation.org, Michal Hocko , linux-man References: <1580434395-9962-1-git-send-email-lixinhai.lxh@gmail.com> From: Mike Kravetz Message-ID: <07cd0750-d908-dd3b-dee1-bc3fcf5bf771@oracle.com> Date: Mon, 10 Feb 2020 09:19:48 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <1580434395-9962-1-git-send-email-lixinhai.lxh@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9527 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxscore=0 malwarescore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002100130 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9527 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 malwarescore=0 impostorscore=0 clxscore=1015 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002100130 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000196, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 1/30/20 5:33 PM, Li Xinhai wrote: > MPOL_MF_STRICT is used in mbind() for purposes: > (1) MPOL_MF_STRICT is set alone without MPOL_MF_MOVE or MPOL_MF_MOVE_ALL, > to check if there is misplaced page and return -EIO; > (2) MPOL_MF_STRICT is set with MPOL_MF_MOVE or MPOL_MF_MOVE_ALL, to check > if there is misplaced page which is failed to isolate, or page is > success on isolate but failed to move, and return -EIO. > > For non hugepage mapping, (1) and (2) are implemented as expectation. > For hugepage mapping, (1) is not implemented. And in (2), the part about > failed to isolate and report -EIO is not implemented. > > This patch implements the missed parts for hugepage mapping. Benefits > with it applied: > - User space can apply same code logic to handle mbind() on hugepage and > non hugepage mapping; > - Reliably using MPOL_MF_STRICT alone to check whether there is misplaced > page or not when bind policy on address range, especially for address > range which contains both hugepage and non hugepage mapping. > > Analysis of potential impact on existing users: > - For users who using MPOL_MF_STRICT alone, since mbind() don't report > reliable answer about misplaced page, their existing code have to > utilize other facilities, e.g. numa_maps of proc, to check misplaced > page. After this patch applied, that dedicated checking will still work > without been impacted; > - For users who using MPOL_MF_STRICT with MPOL_MF_MOVE or > MPOL_MF_MOVE_ALL, the semantic about some pages could not be moved will > not be changed by this patch, because failed to isolate and failed to > move have same effects to users, so their existing code will not be > impacted. > > In mbind man page, the note about 'MPOL_MF_STRICT is ignored on huge page > mappings' can be removed after this patch is applied. > > Signed-off-by: Li Xinhai > Cc: Michal Hocko > Cc: Mike Kravetz > Cc: Naoya Horiguchi > Cc: linux-man Hello Naoya, Do you have any thoughts on this? In previous discussions you suggested this approach of removing the special casing for hugetlb pages. The code looks good to me and patch is fine with commmit message modification. Just wanted to get your opinion. -- Mike Kravetz