Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1730984ybg; Sat, 19 Oct 2019 01:16:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmra3vvCMKFHFCsiWqLaEmSHlTOAlr1hTXKuSUHg+jNcv1+UMU7a5lFvgQx1Dd8Na4bucG X-Received: by 2002:a50:b083:: with SMTP id j3mr13886785edd.15.1571472978535; Sat, 19 Oct 2019 01:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571472978; cv=none; d=google.com; s=arc-20160816; b=j2iVqJLrOpCg8yGnTCsXHIoeXoHpiiYErt/R5LAx4lER2xappDEjFDjjSRkzvzFQzC d8OMdkzZZ7QqDaCKYiIPgwxVUQrs9LYZFJuqoWve+Vrj+7daf2JA4nZu1FkXThvsxey8 7UaFkMdldyw+g/Ywk7Fc6sqbi5+2IUZLnYyXv1zdXwdu8vW4A2q41U7bXY4vMW7ZWQJK Wr5qtcsv/468GGcZkyeBNEWN/sfqorq+ndHEVuf/LrDUOJIU9aDb3+AwlNFumk53Stgu 2f/vFzB6uR60mQnvzF71O7NqbtOSQce5H91CE9w0p7/wrkuFdMFlqDhnDzhlKinz0aPR 4yqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject; bh=nzaC5kjJqmyFSD2AkTri0a1jGeB/x5yHQxSVfHydp+M=; b=oxQcEDlDCzsyri9oZajo0puGBeUUrS+wWI6ql0mK2Y0RNPBUE68bSU9c0hzoSelmmt Pd+u7xN6SnhQZOOtOLzEDLSwvK409SxPyu9EQwf4Z84K9io0UzEVreZtBzknZuq/vm8B oqHS36JFA4rQKlEy8Q4a86vCoCmb72eFjLWrQnHuoHKUOllk4ASOjgCJTyHIsXUR0+Ae InjfFNqkKag6atCmn+aULxMGrayhmzOuYRWpqEmy74yILXtrat3IgxvuyRNKW1Tu5KWd 4xbepho9C/9UN2kvtzIza/ZiK5auKzmbeRea87uEvO3KaSvM8AZIfbfAklPEtNCGL9Ds uo/g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h28si5915091edh.278.2019.10.19.01.15.55; Sat, 19 Oct 2019 01:16:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392915AbfJRLFM (ORCPT + 99 others); Fri, 18 Oct 2019 07:05:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48962 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390762AbfJRLFM (ORCPT ); Fri, 18 Oct 2019 07:05:12 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51730307B194; Fri, 18 Oct 2019 11:05:12 +0000 (UTC) Received: from [10.36.118.23] (unknown [10.36.118.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id F367A19C77; Fri, 18 Oct 2019 11:05:10 +0000 (UTC) Subject: Re: memory offline infinite loop after soft offline From: David Hildenbrand To: Michal Hocko Cc: Naoya Horiguchi , Qian Cai , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Mike Kravetz References: <1570829564.5937.36.camel@lca.pw> <20191014083914.GA317@dhcp22.suse.cz> <20191017093410.GA19973@hori.linux.bs1.fc.nec.co.jp> <20191017100106.GF24485@dhcp22.suse.cz> <1571335633.5937.69.camel@lca.pw> <20191017182759.GN24485@dhcp22.suse.cz> <20191018021906.GA24978@hori.linux.bs1.fc.nec.co.jp> <33946728-bdeb-494a-5db8-e279acebca47@redhat.com> <20191018082459.GE5017@dhcp22.suse.cz> <20191018085528.GG5017@dhcp22.suse.cz> <3ac0ad7a-7dd2-c851-858d-2986fa8d44b6@redhat.com> Organization: Red Hat GmbH Message-ID: <85f944c7-62b8-0784-2f1f-e762b974d317@redhat.com> Date: Fri, 18 Oct 2019 13:05:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <3ac0ad7a-7dd2-c851-858d-2986fa8d44b6@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 18 Oct 2019 11:05:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.10.19 13:00, David Hildenbrand wrote: > On 18.10.19 10:55, Michal Hocko wrote: >> On Fri 18-10-19 10:38:21, David Hildenbrand wrote: >>> On 18.10.19 10:24, Michal Hocko wrote: >>>> On Fri 18-10-19 10:13:36, David Hildenbrand wrote: >>>> [...] >>>>> However, if the compound page spans multiple pageblocks >>>> >>>> Although hugetlb pages spanning pageblocks are possible this shouldn't >>>> matter in__test_page_isolated_in_pageblock because this function doesn't >>>> really operate on pageblocks as the name suggests. It is simply >>>> traversing all valid RAM ranges (see walk_system_ram_range). >>> >>> As long as the hugepages don't span memory blocks/sections, you are right. I >>> have no experience with gigantic pages in this regard. >> >> They can clearly span sections (1GB is larger than 128MB). Why do you >> think it matters actually? walk_system_ram_range walks RAM ranges and no >> allocation should span holes in RAM right? >> > > Let's explore what I was thinking. If we can agree that any compound > page is always aligned to its size , then what I tell here is not > applicable. I know it is true for gigantic pages. > > Some extreme example to clarify > > [ memory block 0 (128MB) ][ memory block 1 (128MB) ] > [ compound page (128MB) ] > > If you would offline memory block 1, and you detect PG_offline on the s/PG_offline/PG_hwpoison/ :) > first page of that memory block (PageHWPoison(compound_head(page))), you > would jump over the whole memory block (pfn += 1 << > compound_order(page)), leaving 64MB of the memory block unchecked. > > Again, if any compound page has the alignment restrictions (PFN of head > aligned to 1 << compound_order(page)), this is not possible. > > > If it is, however, possible, the "clean" thing would be to only jump > over the remaining part of the compound page, e.g., something like > > pfn += (1 << compound_order(page)) - (page - compound_head(page))); > > > -- Thanks, David / dhildenb