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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 200EACA9EA4 for ; Fri, 18 Oct 2019 11:00:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D9CBD222CC for ; Fri, 18 Oct 2019 11:00:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9CBD222CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8422A8E0005; Fri, 18 Oct 2019 07:00:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F1A88E0003; Fri, 18 Oct 2019 07:00:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 707208E0005; Fri, 18 Oct 2019 07:00:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0053.hostedemail.com [216.40.44.53]) by kanga.kvack.org (Postfix) with ESMTP id 4E3288E0003 for ; Fri, 18 Oct 2019 07:00:49 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id DC1C0443C for ; Fri, 18 Oct 2019 11:00:48 +0000 (UTC) X-FDA: 76056612576.11.board69_41419d5fa0f50 X-HE-Tag: board69_41419d5fa0f50 X-Filterd-Recvd-Size: 3992 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Oct 2019 11:00:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34B2318C426B; Fri, 18 Oct 2019 11:00:47 +0000 (UTC) Received: from [10.36.118.23] (unknown [10.36.118.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD701614EE; Fri, 18 Oct 2019 11:00:45 +0000 (UTC) Subject: Re: memory offline infinite loop after soft offline 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> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <3ac0ad7a-7dd2-c851-858d-2986fa8d44b6@redhat.com> Date: Fri, 18 Oct 2019 13:00:45 +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: <20191018085528.GG5017@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Fri, 18 Oct 2019 11:00:47 +0000 (UTC) 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 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 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