From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7D33C433DB for ; Tue, 23 Feb 2021 23:58:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2A43164EC1 for ; Tue, 23 Feb 2021 23:58:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A43164EC1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 979FE6B0006; Tue, 23 Feb 2021 18:58:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 92B5A6B006C; Tue, 23 Feb 2021 18:58:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F1FD6B006E; Tue, 23 Feb 2021 18:58:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0241.hostedemail.com [216.40.44.241]) by kanga.kvack.org (Postfix) with ESMTP id 687C86B0006 for ; Tue, 23 Feb 2021 18:58:09 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1FDFF1801877C for ; Tue, 23 Feb 2021 23:58:09 +0000 (UTC) X-FDA: 77851198698.04.41F622B Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf24.hostedemail.com (Postfix) with ESMTP id 5BC4AA0009E8 for ; Tue, 23 Feb 2021 23:58:03 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 24ED164EBB; Tue, 23 Feb 2021 23:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1614124687; bh=bZ30MhhE5ZCrYTDGI5TcYFn+yUYa2L1/c+U8urUIaA4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kaapH1nbcdcQTJjVB/1rgD+6QVpXSAmgx1NeeiD1BMDUwFxjTECDcfPkS2nuKqSci 3iVmmRgvGAhyh4FfSYtP0YpF6Eq/Pe41wmPu02zccRS8joqNtZn5/kWDRXt1u9k2pc pju/+VdtnLSWiaetDQHxm/9ySwEzRQCLmsJy3PjQ= Date: Tue, 23 Feb 2021 15:58:06 -0800 From: Andrew Morton To: Mike Kravetz Cc: Gerald Schaefer , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Heiko Carstens , Sven Schnelle Subject: Re: [RFC] linux-next panic in hugepage_subpool_put_pages() Message-Id: <20210223155806.8e2284682df5d08ce9b3da68@linux-foundation.org> In-Reply-To: <3c536d3c-a180-301b-5cb7-c737a178a9d7@oracle.com> References: <20210223155740.553df3ee@thinkpad> <3c536d3c-a180-301b-5cb7-c737a178a9d7@oracle.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: 6ptwwcwd8wpyoxm1963wu3bkpxgkpjxz X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 5BC4AA0009E8 Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614124683-733477 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 23 Feb 2021 10:06:12 -0800 Mike Kravetz wrote: > On 2/23/21 6:57 AM, Gerald Schaefer wrote: > > Hi, > > > > LTP triggered a panic on s390 in hugepage_subpool_put_pages() with > > linux-next 5.12.0-20210222, see below. > > > > It crashes on the spin_lock(&spool->lock) at the beginning, because the > > passed-in *spool points to 0000004e00000000, which is not addressable > > memory. It rather looks like some flags and not a proper address. I suspect > > some relation to the recent rework in that area, e.g. commit f1280272ae4d > > ("hugetlb: use page.private for hugetlb specific page flags"). > > > > __free_huge_page() calls hugepage_subpool_put_pages() and takes *spool from > > hugetlb_page_subpool(page), which was changed by that commit to use > > page[1]->private now. > > > > Thanks Gerald, > > Yes, I believe f1280272ae4d is the root cause of this issue. In that > commit, the subpool pointer was moved from page->private of the head > page to page->private of the first subpage. The page allocator will > initialize (zero) the private field of the head page, but not that of > subpages. So, that bad subpool pointer is likely an old page->private > value for the page. > > That strange call path from set_max_huge_pages to __free_huge_page is > actually how the code puts newly allocated pages on it's interfal free > list. > > I will do a bit more verification and put together a patch (it should > be simple). There's also Michel's documentation request: https://lkml.kernel.org/r/20210127102645.GH827@dhcp22.suse.cz