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 6E859C33CB1 for ; Wed, 15 Jan 2020 04:32:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 02F79222C3 for ; Wed, 15 Jan 2020 04:32:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="DqU3uvEv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02F79222C3 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 3F4B28E0005; Tue, 14 Jan 2020 23:32:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 37DBE8E0003; Tue, 14 Jan 2020 23:32:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 21E328E0005; Tue, 14 Jan 2020 23:32:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0038.hostedemail.com [216.40.44.38]) by kanga.kvack.org (Postfix) with ESMTP id 0783B8E0003 for ; Tue, 14 Jan 2020 23:32:44 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id C373C3AB6 for ; Wed, 15 Jan 2020 04:32:43 +0000 (UTC) X-FDA: 76378597806.27.salt57_6f15de47c2040 X-HE-Tag: salt57_6f15de47c2040 X-Filterd-Recvd-Size: 6263 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jan 2020 04:32:43 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00F4TRX4026254; Wed, 15 Jan 2020 04:32:38 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=M9cY34R2NQt3q9QvW4/BpWihv7dRiUn3uOWI1zTEDGk=; b=DqU3uvEvtNOunHrM1ZNODQWqiaNzgTomYJiQqDpO7Qjsxtb3Y9o1hREnK513dfKIcMto PC8oNmGVSj0IKx9L4kEL6c/eIK77KGWWKaBoMZmiH/wuKklNMdXQ8s+sxTglHWY5lnOA 1QDzxGgXOcy0usnsarRz7PPJt43BxdxHNkkdchbm/psB6VCA4xj2le3PTMiOHakFI1Jo RGh3TDPGPVwP1MW8eE+qNB+wtS+2ccM8SIvkHX/w15YHoAwtF5h4KMuUV5hQOq6WYbH6 lmfd/FyFak3le9kctKMKpvJz4G4vJIz7NtUUf8VrxNf1uqVBRMJi0aLyotPTaJxJYRCi 1w== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2xf73yj0wf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Jan 2020 04:32:38 +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 00F4UXpP048350; Wed, 15 Jan 2020 04:30:37 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2xh2tpvheq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Jan 2020 04:30:37 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 00F4SWMw024397; Wed, 15 Jan 2020 04:28:33 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 14 Jan 2020 20:28:32 -0800 Subject: Re: [PATCH 2/2] mm/mempolicy: Skip walking HUGETLB vma if MPOL_MF_STRICT is specified alone To: Yang Shi , Li Xinhai , "linux-mm@kvack.org" Cc: akpm , mhocko , 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> <7c26d332-c40a-0271-b408-a2079ab00808@linux.alibaba.com> From: Mike Kravetz Message-ID: Date: Tue, 14 Jan 2020 20:28:31 -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: <7c26d332-c40a-0271-b408-a2079ab00808@linux.alibaba.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=9500 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001150036 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9500 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001150036 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/14/20 5:24 PM, Yang Shi wrote: > > > On 1/14/20 5:07 PM, Mike Kravetz wrote: >> On 1/14/20 6:09 AM, Li Xinhai wrote: >>> Add cc to >>> Yang Shi >>> Naoya Horiguchi >>> , who has been worked on this part >>> >>> On 2020-01-14 at 17:16 Li Xinhai wrote: >>>> Checking MPOL_MF_STRICT is ignored for HUGETLB vma according to mbind man >>>> page: >>>> >>>> Notes >>>> MPOL_MF_STRICT is ignored on huge page mappings. >>>> >>>> If MPOL_MF_STRICT is specified alone without any MOVE flag, we should >>>> indicate, from test_walk, that walking this vma should be skipped even if >>>> there are misplaced pages. >>>> >>>> Signed-off-by: Li Xinhai >>>> Cc: Michal Hocko >>>> Cc: Mike Kravetz >> I do not necessarily disagree with the change. However, this has made me >> question a couple things: >> 1) Why does the man page say MPOL_MF_STRICT is ignored on huge page mappings? >> - Is that leftover from the the days when huge page migration was not >> supported? >> - Is it just because huge page migration is more likely to fail than >> base page migration. >> 2) Does the mbind code function properly when unable to migrate a huge page >> MPOL_MF_STRICT is set? A quick look at the code looks like it returns >> EIO. > > I don't know the answer about question #1 I didn't dig into the history. The queue_pages_hugetlb() returns 0 unconditionally, I think this is what "MPOL_MF_STRICT is ignored on huge page mappings" means in code. > > It would return -EIO for base pages or THP as what the manpage describes. > I was thinking about a migration failure after isolation. This block of code in do_mbind() after queue_pages_range() and mbind_range(). if (!err) { int nr_failed = 0; if (!list_empty(&pagelist)) { WARN_ON_ONCE(flags & MPOL_MF_LAZY); nr_failed = migrate_pages(&pagelist, new_page, NULL, start, MIGRATE_SYNC, MR_MEMPOLICY_MBIND); if (nr_failed) putback_movable_pages(&pagelist); } if ((ret > 0) || (nr_failed && (flags & MPOL_MF_STRICT))) err = -EIO; -- Mike Kravetz