Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6421030imu; Wed, 14 Nov 2018 00:55:11 -0800 (PST) X-Google-Smtp-Source: AJdET5fzggAD8f9yZxJN7hpueAJ9LtgPbMQx5Zq9ZzUuvJBY3N69NHa2F+BeXsx3BDq4FxiAFZyQ X-Received: by 2002:aa7:8719:: with SMTP id b25-v6mr1048636pfo.250.1542185711027; Wed, 14 Nov 2018 00:55:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542185711; cv=none; d=google.com; s=arc-20160816; b=TB1GsxPfLOePQHeLo2BwrkE450G1ikzB3bTyMXpjf6wPTGzsu7YTC2kyr5s0XumIGn u1O9fw/40kSbVN/TCoPnThhxKQOhz4+GF4oKgzNODB8z/Sz3kJXhj8PCalMIhYughTzo ZbNrLp2t/xbnKEaHizwZBgzGlPCO/uObsjCUN2/ap3krIF3K2sI4FPOllnfFLXBe2xEL XYnABUu2MYLbVRaAr1Z1BlyBuOkng2apWiQ4MnbXtAvhKuKqhUFLWe4g4ZcBVRtfDpVJ 78Y/bD/awV07rXkCRQkYD8ur08RUl4iiJLZLka6amHCRvq2XA2LK2tDCevGCYXJsW/LK +8Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=H4tF3FJjpwj4pbta6WH6mCd6RkHnKOZnlg+UZT1Cs7o=; b=xMMASyBhKDKmjVp7s3UDY428/ezNrmEzVwCI4MEJDorsHOK0fHLWjkXv4U9ou0Yg0W /oihbPd5QdyT6+SLJrsGhGgF4YuF6C+SKquNTb5PTC3If/fwRetCfePuiNBXLeyVLiuj BwLcCktewb+ntV5Dv22+mb9CImvLLIHws0y8GsMY+xn7ra8ZHzAwRbeldGCBeK0AdQpA Zh2ZqQ3VS8jG7JB7Xsu5H5EVEJje2wJYYJH+e23mmv7qT7Y+ymT0sGTF+cjk+sJs8Fni NT4rzaFc+XgaoilXuskG1GlWXfLsMQVxaHzOew6K/wdp9GEb5P6HkVasjWrJ6GIbeEdn hbBw== 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 u129-v6si17737737pfb.201.2018.11.14.00.54.55; Wed, 14 Nov 2018 00:55:10 -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 S1732044AbeKNS4R (ORCPT + 99 others); Wed, 14 Nov 2018 13:56:17 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:40244 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727154AbeKNS4R (ORCPT ); Wed, 14 Nov 2018 13:56:17 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D1D10EBD; Wed, 14 Nov 2018 00:53:58 -0800 (PST) Received: from [10.162.42.147] (p8cg001049571a15.blr.arm.com [10.162.42.147]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 15C873F5CF; Wed, 14 Nov 2018 00:53:55 -0800 (PST) Subject: Re: [RFC][PATCH v1 02/11] mm: soft-offline: add missing error check of set_hwpoison_free_buddy_page() To: Naoya Horiguchi Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Michal Hocko , Andrew Morton , Mike Kravetz , "xishi.qiuxishi@alibaba-inc.com" , Laurent Dufour 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> <20181113001652.GA5945@hori1.linux.bs1.fc.nec.co.jp> From: Anshuman Khandual Message-ID: Date: Wed, 14 Nov 2018 14:23:52 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181113001652.GA5945@hori1.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset=iso-2022-jp Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/13/2018 05:46 AM, Naoya Horiguchi wrote: > 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. Makes sense. Thanks.