Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp160137pxb; Tue, 23 Feb 2021 21:39:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwb5HP9xxNwxrXdKgdkRuVRfQ2eHj7tIzCiGAMRCaTyataQAoHFeYXIOCo77JZSxUsI1nYy X-Received: by 2002:a05:6402:5250:: with SMTP id t16mr31280672edd.302.1614145173718; Tue, 23 Feb 2021 21:39:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614145173; cv=none; d=google.com; s=arc-20160816; b=bICEtt36bfu7mMBM3lDdA5mIR6Iov3Xrm/+gsdb8ISIIJ4XOlPdUb+YydwrdFdhiFB jvcm0QAUHSN+XwKJKVMaFiyieZUgPQQtG+uDyMVpm39qW7sRunoUsQ5o+6A05Jq7zTKr 4XScPggYsW6qlhsF+8sNSSLfGgKJcyoH0W12rw2B29x3LGIRAPQ2dJyPBVZCtXbt7gpV IeN/9DwsTzookwA/GUqDFgE9JE+dbifdF7oZZLqDjSJwBRwpP32zBCJaI6GsUGm3c2hk 43ZdAEO8WrGbz1rVzn6UrKbYVLySgiYsANZSNTQL2ycOCE2/eKVZfVJrOuNAw8+AIwRj 2z+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=H2Lydj1q8Eq00xKZyGcQ4UDcdeTvSXwa+9hwgAztd8Y=; b=b6dDaeHdY/GHJzAI2bOi6LjeIVpk411MU6FLvJwTVsJg8SS7IbgMYDgF3AQknOtXRa 7qKoPpzpdx6oQ609I3qY0HE5DaO2T2488n5uxMCxTiqgZeayGS2uKo80iz7OZDF2BZXP 6IZtxRTBuhQ8gliTtzuBxrq31DQERtjI2maN+wM9gfxei3B2kk2t2YLV3PKlseFmqBiy 9AoSq8+6Pwui1B5oEoQWSrh2pXt+KklRyu/zrpUwlI48Mi9IWBdPrU1S+B2KMQFIAoj7 JWBdYAg0YvdB0Pl6oNJPI/65dGvkJ6oJ+j9tAIHkRsOm+75iyMSDLfA0doA8R2kneTtV 0ffg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=kaapH1nb; 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 p24si685989ejw.511.2021.02.23.21.39.09; Tue, 23 Feb 2021 21:39:33 -0800 (PST) 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=@linux-foundation.org header.s=korg header.b=kaapH1nb; 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 S234545AbhBXApC (ORCPT + 99 others); Tue, 23 Feb 2021 19:45:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:57598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234679AbhBXAEj (ORCPT ); Tue, 23 Feb 2021 19:04:39 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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