Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2897281pxj; Mon, 17 May 2021 12:28:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/dCt1ON2ZngWoIKPLMOl1iWLp7Ql1GPis4ypXX8/G6KW0rarfEaOABO8kKwHBMcUqBR/f X-Received: by 2002:a05:6e02:154d:: with SMTP id j13mr1012891ilu.46.1621279714314; Mon, 17 May 2021 12:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621279714; cv=none; d=google.com; s=arc-20160816; b=mgOdHD58RUt3P/Af9OMVb/iOjQU43YKNOFky51noq2mvFXvV5t6fAGbDEgq0XzGD24 ewjFKfTLQRzt7P4tjX+sa/YJ2ufRo77JOA48P4MW7e05d764TmXxqcYLW7jKcKCOUGQm c6Yv5eaxhqVQ86hGQo/sH43/KhcPv0FCEp7GSQNc0JBEQnFXHsQ+16KQCw6tySXikELZ XCLFMsm41cgyaeU1QszAgboMpwdsllVd0A6x/TrJg7nm6Keb/egn2WC3qUYjoSb/jAgJ f5LB3+j9YUMZTtOOHL8YvuhSwQBMyg0hx6nqCRRTsbCAER+T1c30CFmqS3qdhPxf01Ra oEPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=zqm8mekmU7LR1aukJi4FJlxa9uSCmaUFTRarIjYbVuA=; b=fbbuFCXn0Uq2nh8AQxOENGiTpuRSXulzjG7kxGr8ZlmrY2vIimrCUo7mz+OtrW9w3S ylwhxZsVmiuOM3YEKcNAaGmPNfQ6PjckrE15cJZRIWjesoqW7zIIgW0L5ThXU3L/1u2h 4L08U5emFQfz2AOTHkdMnVH95qwWp0MZP6HMZuo1ieiUwGt1lOq7cTuZPJoUrb5pWKkn cM+QJILWHL4kYrFq9HaaMdHlvNHrAyjymwmhEU5qgXD2OtXacdnGbJeGjjy3rEhYWpol ViMFMEvwKXFVzRpHu9zmegMKpEkwIst1wXgRjOqDg5vghfkbG0N4ObvxVx5NyvjmsRiF hrdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si17083024ioh.74.2021.05.17.12.28.21; Mon, 17 May 2021 12:28:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234141AbhEQNAY (ORCPT + 99 others); Mon, 17 May 2021 09:00:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:52860 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbhEQNAY (ORCPT ); Mon, 17 May 2021 09:00:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 51850AEF5; Mon, 17 May 2021 12:59:07 +0000 (UTC) Date: Mon, 17 May 2021 14:59:03 +0200 From: Oscar Salvador To: Naoya Horiguchi Cc: Muchun Song , linux-mm@kvack.org, Andrew Morton , Mike Kravetz , Michal Hocko , Tony Luck , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] mm,hwpoison: make get_hwpoison_page call get_any_page() Message-ID: <20210517125859.GA25228@linux> References: <20210517045401.2506032-1-nao.horiguchi@gmail.com> <20210517045401.2506032-3-nao.horiguchi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210517045401.2506032-3-nao.horiguchi@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 01:54:01PM +0900, Naoya Horiguchi wrote: > static int __get_hwpoison_page(struct page *page) > { > struct page *head = compound_head(page); > @@ -1098,7 +1091,9 @@ static int __get_hwpoison_page(struct page *page) > > #ifdef CONFIG_HUGETLB_PAGE > spin_lock(&hugetlb_lock); > - if (PageHuge(head) && (HPageFreed(head) || HPageMigratable(head))) > + if (!PageHuge(head)) > + ret = -EBUSY; Unless I'm missing something, we will be returning -EBUSY for any non-hugetlb page, which is not right. I think what you want is to return -EBUSY in case the page is a hugetlb page but we cannot grab a refcount because the page is in a floating state, meaning !HPageFreed && !HPageMigratable. Right? -- Oscar Salvador SUSE L3