Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp609394pxj; Thu, 27 May 2021 07:45:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1VgzqkJE9Ump1d7eACmQmBndTra1tLMYlVt6G5ocNL86Pha40u1fIL0V6oEnujbzVYhhB X-Received: by 2002:aa7:d70e:: with SMTP id t14mr4492956edq.377.1622126734094; Thu, 27 May 2021 07:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622126734; cv=none; d=google.com; s=arc-20160816; b=0WZKXChxujo29/8vZ7SQpoy6sl4ecBJkhbEm8i7bxeh2KH8MWaBUSu9ss+Wf9I/+WS nRuy7DJBh1UQdZKKHO2Tgv6kPuMtTS0q7aZLrHjgELFC72Zb3hpYUiD+gAmAVjboirqy tNqr4g4kWJ0nlVaNlax010dQwVDrrz6bgz/87G/47SHnSw073AanLlVN7Tr3fCr4Urg0 btXVl3EX8ZL7o9JM8jEYmI9SdsEOyUjh3Rq6xj6nfPE2Z7p9ksO13MdEPjiMlxRVIDoJ 79taDI27+T6SWxqKL2iJstrShdyOtw99cF17hoGUyN46FmwCiR1rY9hymyONyeOZJ1Bu iLcg== 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 :dkim-signature; bh=YtO/FPGQ00p8RJySPIi3YpYdx7Hc9TaIxbimA4veYEo=; b=r1cAIQ0RPVHoGIc6w3u6aOfvNhY9stdUStMPpFq0yR9f08GI8RGzeLOnaUp/oE1ij+ TN9v8lrhDVZ3HcejlKBtbRACH7NbNpog9ru4qMlKX/bdo+5x+LvKAGnY1cTl/pelQwea TmLM+xpgwA8xoQCysIAfrs+dxNAEPq1HWuWXfuO4Bur4N8N6See02MPOWwNNEKGTrVDV ZKMX7h7vhLgH3RJboRweFGpFhwQtFjYKsDUHyV6q8hKBagbM9xKcgg9FrEmZJCGkePzu NwKb2NBboYzYDI542w1y8nIeZw8s7Fil6+OXvurDesn/+3ouvmpjNiW1/v0NeO6793CY Q1Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=0jMjswuq; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=xYql4C3q; 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 d24si2313326ejd.49.2021.05.27.07.45.07; Thu, 27 May 2021 07:45: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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=0jMjswuq; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=xYql4C3q; 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 S235098AbhE0HtW (ORCPT + 99 others); Thu, 27 May 2021 03:49:22 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:54078 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234626AbhE0HtU (ORCPT ); Thu, 27 May 2021 03:49:20 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A2330218DD; Thu, 27 May 2021 07:47:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622101666; 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=YtO/FPGQ00p8RJySPIi3YpYdx7Hc9TaIxbimA4veYEo=; b=0jMjswuqM3ju6nongb+Egwt0eOKJByPjqb7MWzJneWPk7esOWKvfI99Z9LrRO7xriyF3E8 3yYUdpK1esyrQx7xqsrdel2EUqlyGpFJv/IVrqZx9DCNe6MLRxb2sA/tfw44/doycGIPKb OTM2gx1Q1GWas/Qmr9g39pKls+vKInA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622101666; 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=YtO/FPGQ00p8RJySPIi3YpYdx7Hc9TaIxbimA4veYEo=; b=xYql4C3qYFxsP6Ur19ynYgw/EFoxCZSqDWVIknwMaDVd9elA0IEhTfrM0uQ065tH2JKY4a 17aUUNincV3zEYDQ== Received: from director2.suse.de (director2.suse-dmz.suse.de [192.168.254.72]) by imap.suse.de (Postfix) with ESMTPSA id 0962311A98; Thu, 27 May 2021 07:47:45 +0000 (UTC) Date: Thu, 27 May 2021 09:47:44 +0200 From: Oscar Salvador To: Naoya Horiguchi Cc: linux-mm@kvack.org, Mike Kravetz , Michal Hocko , 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. > > 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. Thanks -- Oscar Salvador SUSE L3