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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 A3451CA9EC3 for ; Thu, 31 Oct 2019 04:31:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5F80A2087F for ; Thu, 31 Oct 2019 04:31:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ngIQBfRV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F80A2087F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D016F6B0003; Thu, 31 Oct 2019 00:31:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB44A6B0005; Thu, 31 Oct 2019 00:31:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B9F9A6B0007; Thu, 31 Oct 2019 00:31:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id 937116B0003 for ; Thu, 31 Oct 2019 00:31:47 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 2FFBD584F for ; Thu, 31 Oct 2019 04:31:47 +0000 (UTC) X-FDA: 76102806654.07.boot71_2ca5c8290f214 X-HE-Tag: boot71_2ca5c8290f214 X-Filterd-Recvd-Size: 3021 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 31 Oct 2019 04:31:46 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 75D5420862; Thu, 31 Oct 2019 04:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572496305; bh=/vZVdjfx1+eTSFpDQ3YOtaUgovcc9xcDfUIxOh8R22I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ngIQBfRVYieR754lwPCFY+0f48qLBs7EhpJ8sl+stFK9/SW4b/hfY8/JlpNlmncLH b86c5OrxpOlpZHy4qOuqc5SqoVTCJdu3biDQv29Bp3CmBCezR+wr0ARKym1rSDnrTh i76l2zZ5lxqJcM8J2tI9aUOG+M3J8kv44C7tUmNU= Date: Wed, 30 Oct 2019 21:31:44 -0700 From: Andrew Morton To: Yang Shi Cc: lixinhai.lxh@gmail.com, vbabka@suse.cz, mhocko@suse.com, mgorman@techsingularity.net, stable@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Li Xinhai" Subject: Re: [PATCH] mm: mempolicy: fix the wrong return value and potential pages leak of mbind Message-Id: <20191030213144.dd7cd8084d4171e29abba875@linux-foundation.org> In-Reply-To: <12ac5b41-27a6-5a5b-0d07-7e9cb847829d@linux.alibaba.com> References: <1572454731-3925-1-git-send-email-yang.shi@linux.alibaba.com> <12ac5b41-27a6-5a5b-0d07-7e9cb847829d@linux.alibaba.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Wed, 30 Oct 2019 11:14:58 -0700 Yang Shi wrote: > On 10/30/19 9:58 AM, Yang Shi wrote: > > The commit d883544515aa ("mm: mempolicy: make the behavior consistent > > when MPOL_MF_MOVE* and MPOL_MF_STRICT were specified") fixed the return > > value of mbind() for a couple of corner cases. But, it altered the > > errno for some other cases, for example, mbind() should return -EFAULT > > when part or all of the memory range specified by nodemask and maxnode > > points outside your accessible address space, or there was an unmapped > > hole in the specified memory range specified by addr and len. > > > > Fixed this by preserving the errno returned by queue_pages_range(). > > And, the pagelist may be not empty even though queue_pages_range() > > returns error, put the pages back to LRU since mbind_range() is not called > > to really apply the policy so those pages should not be migrated, this > > is also the old behavior before the problematic commit. > Forgot fixes tag. > > Fixes: d883544515aa ("mm: mempolicy: make the behavior consistent when > MPOL_MF_MOVE* and MPOL_MF_STRICT were specified") What's the relationship between this patch and http://lkml.kernel.org/r/201910291756045288126@gmail.com?