Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp626667pxj; Thu, 27 May 2021 08:08:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJULJqJ7hRfd9/50MU9f8dtCCQjKoEwRCjrS4f71MIFhAO/EMzBZuUYudEi0s32Pt3iJjO X-Received: by 2002:a6b:b4d8:: with SMTP id d207mr3081990iof.152.1622128117615; Thu, 27 May 2021 08:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622128117; cv=none; d=google.com; s=arc-20160816; b=my1Nnzcy/q1/b3F7kv8VVXQs9r3IOUoG/7NpOx42JcsVCLFZIrPmDe2tyBjoFWQF37 Pvg+fXLEoZ+0b2muWoYOT/IGGiH5Abw7vemYxdvOxc3i+Ppfhs6fEhOmQkdp2imQeVry 1ftZXe9M3XPBL44bSd8uQU6kdpabNtAx6C08L1S34pH1hRexsjZRYTS//h9T9Be/zOnG yC/dJSG3TC3QSc6CK/NYBiKSkLCCGNL8Ah1W+HrdzzJWDXZa6Kkk+Lncj7b+ww/BTaXf iXL22gU1V1eIVVusJxsfF9j1nfIaa8RjvH7Fg/wnQ3RRLoSj0xYIu7w8LIx+ZPTpSDtf loXQ== 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=+EfkVrIQZXBeZTPSxjNuEm8wUQKfD3cTZZ/zTTMSBzw=; b=eLy8cmfddpr6RYTmTJQao7ZT9CFJVK6E6yLO31ZG67Y5cyjyoE04KZUvMdwK/CMUym 9KlnLaq2D9oKENOwh7d/ERVGDmjenHb0dKiie42HrOmcHCdRNBRPkPiD9Sn219B0Mgyz np1eyDa5/sYqeVwqopUFwoJ2VerOl+oRhkBXdYFYy00VUyzR6dZUt2BPAWSd5xE/dNPL teALOWScoAlT25pUc1pPuqaId/VYKkn9gItedy2I/y1EAA+K6rvELGPdX5mzpGaExJYo QV5HjLzxGOqHfjMmn+4GHnI/nv9FU+LYE7l8cyOyvqyyyjl4ziV0vSvCq0kejbDCfwL9 yYzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=iIdOJB9Z; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h31si2499957jav.116.2021.05.27.08.08.23; Thu, 27 May 2021 08:08:37 -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=@suse.com header.s=susede1 header.b=iIdOJB9Z; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235407AbhE0IYB (ORCPT + 99 others); Thu, 27 May 2021 04:24:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:50824 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235400AbhE0IX5 (ORCPT ); Thu, 27 May 2021 04:23:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1622103744; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+EfkVrIQZXBeZTPSxjNuEm8wUQKfD3cTZZ/zTTMSBzw=; b=iIdOJB9ZclOzK1R83f55YqiC+wO2fih/GoA1P6TTFS7h/zJZv+/vjHUezFzt6uULVaRUNQ eLiBhU2Vt0rRbhtKjqCzvjWLKXmuXfKoUvniad9b6jcJksXd04jGHck9f8MPt9I054mw0y VQ+IuJWWlJzLeN4HCvmS7MSB1NRuQbw= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1F646AB71; Thu, 27 May 2021 08:22:24 +0000 (UTC) Date: Thu, 27 May 2021 10:22:23 +0200 From: Michal Hocko To: Oscar Salvador Cc: Naoya Horiguchi , linux-mm@kvack.org, Mike Kravetz , 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 27-05-21 09:47:44, Oscar Salvador wrote: > 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. > > > > Fixes: 6eb4e88a6d27 ("hugetlb: create remove_hugetlb_page() to separate functionality") > > Signed-off-by: Naoya Horiguchi > > Reviewed-by: Oscar Salvador > > It is probably worth adding a comment in remove_hugetlb_page() noting > that we need a head page, so future users do not repeat the same > mistake. Ideally this will turn into page folio concept and no comments are really needed. -- Michal Hocko SUSE Labs