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,NICE_REPLY_A,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 183F4C43457 for ; Mon, 19 Oct 2020 07:25:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 14E05223AB for ; Mon, 19 Oct 2020 07:25:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14E05223AB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4735B6B0068; Mon, 19 Oct 2020 03:25:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 422936B006C; Mon, 19 Oct 2020 03:25:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 339886B006E; Mon, 19 Oct 2020 03:25:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 0439C6B0068 for ; Mon, 19 Oct 2020 03:25:25 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9C1CC181AEF00 for ; Mon, 19 Oct 2020 07:25:25 +0000 (UTC) X-FDA: 77387839410.18.wash86_4d0569927235 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 6E028101EA7E9 for ; Mon, 19 Oct 2020 07:25:25 +0000 (UTC) X-HE-Tag: wash86_4d0569927235 X-Filterd-Recvd-Size: 2465 Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Mon, 19 Oct 2020 07:25:24 +0000 (UTC) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 590CA4BC37FAE14D9FAB; Mon, 19 Oct 2020 15:25:21 +0800 (CST) Received: from [10.174.177.6] (10.174.177.6) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Mon, 19 Oct 2020 15:25:13 +0800 Subject: Re: [PATCH V2] mm: fix potential pte_unmap_unlock pte error To: Michal Hocko CC: , , , , , References: <20201017021151.28104-1-luoshijie1@huawei.com> <20201019065912.GA27114@dhcp22.suse.cz> From: Shijie Luo Message-ID: Date: Mon, 19 Oct 2020 15:25:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20201019065912.GA27114@dhcp22.suse.cz> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.177.6] X-CFilter-Loop: Reflected 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 2020/10/19 14:59, Michal Hocko wrote: > On Fri 16-10-20 22:11:51, Shijie Luo wrote: >> When flags don't have MPOL_MF_MOVE or MPOL_MF_MOVE_ALL bits, code breaks >> and passing origin pte - 1 to pte_unmap_unlock seems like not a good idea. > This would really benefit from some improvements. It is preferable to > provide a user visibile effect of the patch. I would propose this, feel > free to reuse parts as you find fit. > " > queue_pages_pte_range can run in MPOL_MF_MOVE_ALL mode which doesn't > migrate misplaced pages but returns with EIO when encountering such a > page. Since a7f40cfe3b7a ("mm: mempolicy: make mbind() return -EIO when > MPOL_MF_STRICT is specified") and early break on the first pte in the > range results in pte_unmap_unlock on an underflow pte. This can lead to > lockups later on when somebody tries to lock the pte resp. > page_table_lock again.. > > Fixes: a7f40cfe3b7a ("mm: mempolicy: make mbind() return -EIO when > MPOL_MF_STRICT is specified") > " I will take these in my patch description and send version 3, Thanks.