Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp146729pxj; Wed, 26 May 2021 18:44:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPil6nkrHU2FNzZCy3axPyulJuJP3HeUw5WBozYI7lT/29fZ0iaattHOsEEErIBI0E3AjT X-Received: by 2002:a02:3304:: with SMTP id c4mr1089502jae.68.1622079863584; Wed, 26 May 2021 18:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622079863; cv=none; d=google.com; s=arc-20160816; b=vEn3ngSiDH46pNYXheSmtc8PL7McJB6kVfslE4B1kVmRWt5PRxyOh0XmNI2YCTwsi4 hf9thEcVUNGBBZFwmEyZQyfjNapV1ifvYeus5V92lCs0DkXzqP+pBWCRXE0MEO54cSFl Y/51svQBBdIfyBrXlYVU1YolR2POgWs8/hiTepQxQIESx0d5BMCCUMPHWkX0s/Xhvcbd Ddi2I/cvoEwgAfBh4jgbfAiF3mxcVYF2Sy/DHYy37nL6EybPA+tXVxg9GFg+m/B75KBY /ufQe3RcaTQpFnNd/bUUJhmPX53VcxHdffcVLY+SC0gyd+RmBIRqjk8wZf6UNT/X2luT utQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rGnGbvjwxo5pZ/xivVTzhZZksaRg9qYZ3497Lsqz1j0=; b=ua+mQjSZs95AarWi4/TEVMVXB9JUDoY3+o3MwVFETAnRewyNXkVJpVqz2PvKwDXZZZ NcIkBnDX1ZmLjATw/CodtjLRlQuXRiMXPjLTU4AZ98UPqJEgtNoeZ1aqwg0GHVC9fVe7 Nn7EoyDLyhjpJXmIhXylIbOjl052hc7dpY8fyf2CT/FOkz1XE6vVjuIvU5aVtB8Y0VNk 7okrE2/qMHgN7foSJISVtyxKbkoG2mC/vVpQVG9KTQAOF6C57ykyD2TIsMZ/28Juz144 oLRPHDp1IozQfKXwHrae1rZvCnS5WcVf3QLgqYDPDt45pdUWIUPhRYVXMHTGs0Lk01G+ JF0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qik79SlI; 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 y19si727692ili.67.2021.05.26.18.44.10; Wed, 26 May 2021 18:44:23 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qik79SlI; 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 S232956AbhE0AeZ (ORCPT + 99 others); Wed, 26 May 2021 20:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232632AbhE0AeZ (ORCPT ); Wed, 26 May 2021 20:34:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BF55C061574 for ; Wed, 26 May 2021 17:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rGnGbvjwxo5pZ/xivVTzhZZksaRg9qYZ3497Lsqz1j0=; b=qik79SlIXNJdlHZ3tdNFMlPZjf /GX4ppKG7Htrhi1w9MFCnu4/yRx7GW14Jb4z7fpCUJNBOmFcwtW7WEbEcmDBjvWQdrckWQNd8dM2J qFo5EJ8Jug9DpqktI1WAWyoStvwxmufiur4YOKzQWm1lQbSZjq8CZJWXz+UFgk3MsqYjJU8fxXAHx q0W/bBR9AIxQjUBq3AAogSyYWw22TMr/Pqnv9+SpYRzt4C+FVpF2D7e0aVLcpctgx9s4qX0R/9eNl LoRg0MNdURKh6yG+Te38Vwl69F5DKcSAR7ZfbY1d6SxY/ov1XIm5KazcLF8qYNk9tVyWf+Tb0NSUK Iyrl+Y0w==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lm3wB-0051pP-Bz; Thu, 27 May 2021 00:31:54 +0000 Date: Thu, 27 May 2021 01:31:47 +0100 From: Matthew Wilcox To: Naoya Horiguchi Cc: linux-mm@kvack.org, Mike Kravetz , Michal Hocko , Oscar Salvador , Muchun Song , Andrew Morton , David Hildenbrand , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] hugetlb: pass head page to remove_hugetlb_page() Message-ID: References: <20210526235257.2769473-1-nao.horiguchi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210526235257.2769473-1-nao.horiguchi@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 27, 2021 at 08:52:57AM +0900, Naoya Horiguchi wrote: > From: Naoya Horiguchi > > When memory_failure() or soft_offline_page() is called on a tail page of > some hugetlb page, "BUG: unable to handle page fault" error can be > triggered. > > remove_hugetlb_page() dereferences page->lru, so it's assumed that the > page points to a head page, but one of the caller, > dissolve_free_huge_page(), provides remove_hugetlb_page() with 'page' > which could be a tail page. So pass 'head' to it, instead. I'd like to point out that with folios, this is a compile-time error, not a run-time error.