Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4729977imu; Mon, 12 Nov 2018 16:22:21 -0800 (PST) X-Google-Smtp-Source: AJdET5c+r/TgrgCxFBqmurJdCiPo/6ePMkLkjwQl9IsDNuvaorfFdKmqzQs4fvwXRATu+IR72zCe X-Received: by 2002:a17:902:82cb:: with SMTP id u11mr2838696plz.174.1542068541837; Mon, 12 Nov 2018 16:22:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542068541; cv=none; d=google.com; s=arc-20160816; b=Tc0PnTPP087RYs8CvKj9UGn0j9uN/sNiPVM1sm2CD5KmApVkkEDfTMuNFyfHX8qr5M d0ldybl0+X1NX0UEbFIQX/A9HBRN8KWs35cqRp/2LurLQbhDKTRT+xTh8a9PhDCw0bYt GdpXegNwr1JwLD9+uw75NyBHz64bE6T3Q+kkjgabsXwMxiJWsV4OWPKlKmlasg08wRck l8KmIo1AU52x1TvEmWUWTp4+GfNa68Lyvkd9HoIpupkLde5Bo8VGDtfGKmcjbBkuKK8a Xli6XilqYxg29t/sKI9Xj9qkIs1HK2PPkweOpYdnHJ/2JC6G+dEBvh1spnnZ1bWAbgUq THAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from; bh=+eY7I7rIeT3D5GzYQkucfYm5ZCPXdIs52Dk5Nffcmbo=; b=AacgkSLFvyA6ZRWjjozCBar1AGDcdN/Qu2dgjt+VW6eGEJvhRx+lAG3IWjSbIwOeDw xpXWKKSBGKjCdmvoCPSL+KxKlbO5J4VUalzcagVmo05wY6ImPUmnuRH4wyVvhMsRq/3c Hd2fi3dehYqg7ovml6thz/5UnThk44Q9JVRhPGo6GB0ULNTF0aU5Mq84g3qV2ZHx248p OQYvQfWHWkoRVHWpKARp4kU5qDuWLHuHmGitCcZWAuVcrTp4vBmuL1+CBygyuVvpKeu8 21AbgixD+McqoDHrBVdEaajmtbOQt68fUS40yVYfkFuguuGuF7hzxiSn9iuBIwnGRlWu 4XoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12si18756024pgh.488.2018.11.12.16.22.05; Mon, 12 Nov 2018 16:22:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730677AbeKMKRK convert rfc822-to-8bit (ORCPT + 99 others); Tue, 13 Nov 2018 05:17:10 -0500 Received: from tyo162.gate.nec.co.jp ([114.179.232.162]:54783 "EHLO tyo162.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730604AbeKMKRJ (ORCPT ); Tue, 13 Nov 2018 05:17:09 -0500 Received: from mailgate01.nec.co.jp ([114.179.233.122]) by tyo162.gate.nec.co.jp (8.15.1/8.15.1) with ESMTPS id wAD0LCF3022885 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 13 Nov 2018 09:21:12 +0900 Received: from mailsv01.nec.co.jp (mailgate-v.nec.co.jp [10.204.236.94]) by mailgate01.nec.co.jp (8.15.1/8.15.1) with ESMTP id wAD0LCIu027544; Tue, 13 Nov 2018 09:21:12 +0900 Received: from mail02.kamome.nec.co.jp (mail02.kamome.nec.co.jp [10.25.43.5]) by mailsv01.nec.co.jp (8.15.1/8.15.1) with ESMTP id wAD0I6hT019581; Tue, 13 Nov 2018 09:21:12 +0900 Received: from bpxc99gp.gisp.nec.co.jp ([10.38.151.149] [10.38.151.149]) by mail03.kamome.nec.co.jp with ESMTP id BT-MMP-5489556; Tue, 13 Nov 2018 09:16:54 +0900 Received: from BPXM23GP.gisp.nec.co.jp ([10.38.151.215]) by BPXC21GP.gisp.nec.co.jp ([10.38.151.149]) with mapi id 14.03.0319.002; Tue, 13 Nov 2018 09:16:54 +0900 From: Naoya Horiguchi To: Anshuman Khandual CC: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Michal Hocko , "Andrew Morton" , Mike Kravetz , "xishi.qiuxishi@alibaba-inc.com" , "Laurent Dufour" Subject: Re: [RFC][PATCH v1 02/11] mm: soft-offline: add missing error check of set_hwpoison_free_buddy_page() Thread-Topic: [RFC][PATCH v1 02/11] mm: soft-offline: add missing error check of set_hwpoison_free_buddy_page() Thread-Index: AQHUd/gZ2sDE1GCoJU27soosKuzRTKVGpOuAgAWgnwA= Date: Tue, 13 Nov 2018 00:16:53 +0000 Message-ID: <20181113001652.GA5945@hori1.linux.bs1.fc.nec.co.jp> References: <1541746035-13408-1-git-send-email-n-horiguchi@ah.jp.nec.com> <1541746035-13408-3-git-send-email-n-horiguchi@ah.jp.nec.com> <9ea93154-4843-231d-d72b-bf12c8807c24@arm.com> In-Reply-To: <9ea93154-4843-231d-d72b-bf12c8807c24@arm.com> Accept-Language: en-US, ja-JP Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.51.8.80] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anshuman, On Fri, Nov 09, 2018 at 03:50:41PM +0530, Anshuman Khandual wrote: > > > On 11/09/2018 12:17 PM, Naoya Horiguchi wrote: > > set_hwpoison_free_buddy_page() could fail, then the target page is > > finally not isolated, so it's better to report -EBUSY for userspace > > to know the failure and chance of retry. > > > > IIUC set_hwpoison_free_buddy_page() could only fail if the page is not > free in the buddy. At least for soft_offline_huge_page() that wont be > the case otherwise dissolve_free_huge_page() would have returned non > zero -EBUSY. Is there any other reason set_hwpoison_free_buddy_page() > would not succeed ? There is a race window between page freeing (after successful soft-offline -> page migration case) and the containment by set_hwpoison_free_buddy_page(). Or a target page can be allocated just after get_any_page() decided that the target page is a free page. So set_hwpoison_free_buddy_page() would safely fail in such cases. Thanks, Naoya Horiguchi > > > And for consistency, this patch moves set_hwpoison_free_buddy_page() > > in unmap_and_move() to __soft_offline_page(). > > Yeah this check should be handled in soft offline functions not inside > migrations they trigger. >