Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3719457ybg; Sun, 20 Oct 2019 20:19:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5+wY0KWq9TsUeveRV2szOJweKPEwwA9RCTQ7nCYXIkiXhFxA1EHh2Uj1no6SQdjRjKiEM X-Received: by 2002:a17:906:7fd3:: with SMTP id r19mr20275385ejs.46.1571627944235; Sun, 20 Oct 2019 20:19:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571627944; cv=none; d=google.com; s=arc-20160816; b=LCF6euYrIk+Tn4ZAswuWWQSOPuzXRpiCf6l8kwDAqcDhxPUecE8jGqey0NZiFrktp3 LMUW2PEJA5BbJDaYIolLGyX3XJRaXqWU5vLsaIDD2teIc6UdlieHZauCVjLCsdARUk2f IInVyjwJHZGzCidh0EAORIwYqO58cwflUGbs8iIpcuA/Yj5/5ywuXmls63KNHACeYdRH u7n7lRujVoadZFMmWS98BdRvYNGb8S0J+hmp86NGCXvyouMYgZF6C4bc1b1pf7XkCVcV 9fCM4A1vES2VFyXGjeqVOecR+14OHwoQpfwEWypY5eCJIxaOzLTTN5KZWT8UTBmrTroU +EfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from; bh=PrzLt1N1sCl43JP3+eLhbAMmIzx8mc9P1jX/djqIBPw=; b=q8tfdKAkyM6yuY2PGzhwPA3bLSjAKJ4L9eDjbNq6vIdjmgF1EyVDfwc7qChrdETuDd eACeBjGD50t9uHWy2OE3AHCEdu+Wc0j3Buj+n2eXsu3SO+CnUfuOc8PcwPfMedWy0cRD WMkrmJcd4/+BOwYQz2Zf1sPtKTCBP2XCyW6lb5nNNIUpeSp4ps2Aw0dpHk/7psfIwBq/ GkxRmcpWy8YxYJZMJz3Tf9RzKqmZ9uGO5plbzsDOLRgkzGPcdsDKzvXW/WnzEi1GjIlx HJcrAcEesJA7aPB3Z8lS64teuNUEa8zB9tjpd3Lo/WzGPEnfB/TFFDU8bQkfUv/h5b7/ QJ0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i31si2082390eda.147.2019.10.20.20.18.38; Sun, 20 Oct 2019 20:19:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbfJUDSa convert rfc822-to-8bit (ORCPT + 99 others); Sun, 20 Oct 2019 23:18:30 -0400 Received: from tyo162.gate.nec.co.jp ([114.179.232.162]:55714 "EHLO tyo162.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726770AbfJUDSa (ORCPT ); Sun, 20 Oct 2019 23:18:30 -0400 Received: from mailgate01.nec.co.jp ([114.179.233.122]) by tyo162.gate.nec.co.jp (8.15.1/8.15.1) with ESMTPS id x9L3IC1U000642 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 21 Oct 2019 12:18:12 +0900 Received: from mailsv01.nec.co.jp (mailgate-v.nec.co.jp [10.204.236.94]) by mailgate01.nec.co.jp (8.15.1/8.15.1) with ESMTP id x9L3ICmL006879; Mon, 21 Oct 2019 12:18:12 +0900 Received: from mail02.kamome.nec.co.jp (mail02.kamome.nec.co.jp [10.25.43.5]) by mailsv01.nec.co.jp (8.15.1/8.15.1) with ESMTP id x9L3IBxT014625; Mon, 21 Oct 2019 12:18:12 +0900 Received: from bpxc99gp.gisp.nec.co.jp ([10.38.151.149] [10.38.151.149]) by mail03.kamome.nec.co.jp with ESMTP id BT-MMP-69457; Mon, 21 Oct 2019 12:16:42 +0900 Received: from BPXM23GP.gisp.nec.co.jp ([10.38.151.215]) by BPXC21GP.gisp.nec.co.jp ([10.38.151.149]) with mapi id 14.03.0439.000; Mon, 21 Oct 2019 12:16:42 +0900 From: Naoya Horiguchi To: Qian Cai CC: Michal Hocko , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , David Hildenbrand , Mike Kravetz Subject: Re: memory offline infinite loop after soft offline Thread-Topic: memory offline infinite loop after soft offline Thread-Index: AQHVgHtyUduz67i7AUWqxWZ+Pu+7vadZPeAAgATGWACAAAeGAIAAh9KAgAAFzYCAAIOhAIAAP4+AgAAHNACAAFp3gIAEJduA Date: Mon, 21 Oct 2019 03:16:41 +0000 Message-ID: <20191021031641.GA8007@hori.linux.bs1.fc.nec.co.jp> References: <20191018063222.GA15406@hori.linux.bs1.fc.nec.co.jp> <64DC81FB-C1D2-44F2-981F-C6F766124B91@lca.pw> In-Reply-To: <64DC81FB-C1D2-44F2-981F-C6F766124B91@lca.pw> Accept-Language: en-US, ja-JP Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.34.125.96] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <734247A429D4B54397E93A316B55EC7A@gisp.nec.co.jp> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 18, 2019 at 07:56:09AM -0400, Qian Cai wrote: > > > On Oct 18, 2019, at 2:35 AM, Naoya Horiguchi > wrote: > > > You're right, then I don't see how this happens. If the error hugepage was > isolated without having PG_hwpoison set, it's unexpected and problematic. > I'm testing myself with v5.4-rc2 (simply ran move_pages12 and did hotremove > /hotadd) > but don't reproduce the issue yet. Do we need specific kernel version/ > config > to trigger this? > > > This is reproducible on linux-next with the config. Not sure if it is > reproducible on x86. > > https://raw.githubusercontent.com/cailca/linux-mm/master/powerpc.config > > and kernel cmdline if that matters > > page_poison=on page_owner=on numa_balancing=enable \ > systemd.unified_cgroup_hierarchy=1 debug_guardpage_minorder=1 \ > page_alloc.shuffle=1 Thanks for the info. > > BTW, where does the code set PG_hwpoison for the head page? Precisely speaking, soft offline only sets PG_hwpoison after the target hugepage is successfully dissolved (then it's not a hugepage any more), so PG_hwpoison is set on the raw page in set_hwpoison_free_buddy_page(). In move_pages12 case, madvise(MADV_SOFT_OFFLINE) is called for the range of 2 hugepages, so the expected result is that page offset 0 and 512 are marked as PG_hwpoison after injection. Looking at your dump_page() output, the end_pfn is page offset 1 ("page:c00c000800458040" is likely to point to pfn 0x11601.) The page belongs to high order buddy free page, but doesn't have PageBuddy nor PageHWPoison because it was not the head page or the raw error page. > Unfortunately, this does not solve the problem. It looks to me that in > soft_offline_huge_page(), set_hwpoison_free_buddy_page() will only set > PG_hwpoison for buddy pages, so the even the compound_head() has no PG_hwpoison > set. Your analysis is totally correct, and this behavior will be fixed by the change (https://lkml.org/lkml/2019/10/17/551) in Oscar's rework. The raw error page will be taken off from buddy system and the other subpages are properly split into lower orderer pages (we'll properly manage PageBuddy flags). So all possible cases would be covered by branches in __test_page_isolated_in_pageblock. Thanks, Naoya Horiguchi