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.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 EAB62C433ED for ; Wed, 14 Apr 2021 12:02:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7CF026100C for ; Wed, 14 Apr 2021 12:02:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CF026100C 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 00BA66B0083; Wed, 14 Apr 2021 08:02:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F25856B0085; Wed, 14 Apr 2021 08:02:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9F156B0087; Wed, 14 Apr 2021 08:02:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0143.hostedemail.com [216.40.44.143]) by kanga.kvack.org (Postfix) with ESMTP id BA3076B0083 for ; Wed, 14 Apr 2021 08:02:50 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 39CF233CD for ; Wed, 14 Apr 2021 12:02:50 +0000 (UTC) X-FDA: 78030836100.05.CCA52F6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 81FA26000121 for ; Wed, 14 Apr 2021 12:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618401769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aHEy1xNdFom9dP0EOpBshNDqoumwNcfeRvHic4Mkn7s=; b=g82CE/KNiiCBRhsluIJhM5Qthuag5Nud1EDOab4qDyXLaayKiunNTtBX3CSSH4fMmDKhBM kE+EXTqbyrJg4rmklybrDR1OzuRieVl57yGZzBsBRXSCwE8Jit+IXXhHMowEiacpMVGwAT MDQsDWuvIENg/vHMFiA8UyyNr/L/m4M= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-am6JO8g7PmCkQ4bda6L3Gg-1; Wed, 14 Apr 2021 08:02:47 -0400 X-MC-Unique: am6JO8g7PmCkQ4bda6L3Gg-1 Received: by mail-wr1-f72.google.com with SMTP id j4-20020adfe5040000b0290102bb319b87so978553wrm.23 for ; Wed, 14 Apr 2021 05:02:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=aHEy1xNdFom9dP0EOpBshNDqoumwNcfeRvHic4Mkn7s=; b=Pj6S6zdKd0kTKDmXTVS44vKow47qipAyeXKeZwNSCg3hzw3JmLee3SFf7UOOcPsKal D68eQem0HZ8KtvPHGHO+VSJpe/QPXAv6IjdMtkoX76SJizYulJyK3i1gE37Us7LmFlHw xvAaR9bU4b3CpMusTfIU/AJXsXEqFZrqfWgWxd93Conb7lNZfKKRFiF5pN2+gDDMsWZI CBZg0gcdHKwQJz1cNUbZnOg6zHIseQcu2kHn4N+7qQ0zFQW5O+Maf/TUxVnz8jyE3fMw ISe2npSbEo1mvxjLqLAFxnrwoVoEen73owcJbZmkkR1HpApzKJ1PTWLfqgMsJGRInFPZ 5iBQ== X-Gm-Message-State: AOAM532Huk9gxAYfZrqAJAPVPSSQulI02FQyf4x+sJ2G69qLEWWlolB1 DvEZGMA6G5odjw0kjjMnGzSCwrwdjcPAs3J7m9ouD75J34Si/3a15L+p8k+32Ng2LihK55FGeXm usQW6V92jODI= X-Received: by 2002:a05:600c:1992:: with SMTP id t18mr2646076wmq.125.1618401766224; Wed, 14 Apr 2021 05:02:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIckROBZLgsBG6+3ktUXqvlVi8petXLZKUH+TnS84jke/Sld2EXtRQNFhBXCkAQrmXyQQluA== X-Received: by 2002:a05:600c:1992:: with SMTP id t18mr2646058wmq.125.1618401766042; Wed, 14 Apr 2021 05:02:46 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6470.dip0.t-ipconnect.de. [91.12.100.112]) by smtp.gmail.com with ESMTPSA id j23sm5020393wmo.33.2021.04.14.05.02.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Apr 2021 05:02:45 -0700 (PDT) To: Michal Hocko , Oscar Salvador Cc: Mike Kravetz , Andrew Morton , Vlastimil Babka , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210413104747.12177-1-osalvador@suse.de> <20210413104747.12177-4-osalvador@suse.de> <20210414074132.GB20401@linux> <20210414100147.GD20886@linux> <20210414104953.GF20886@linux> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v7 3/7] mm,hugetlb: Clear HPageFreed outside of the lock Message-ID: Date: Wed, 14 Apr 2021 14:02:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Stat-Signature: mauuqw6h6uyrsniiprgmgsx75m6df8r3 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 81FA26000121 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=170.10.133.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618401766-428683 Content-Transfer-Encoding: quoted-printable 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 14.04.21 13:09, Michal Hocko wrote: > On Wed 14-04-21 12:49:53, Oscar Salvador wrote: >> On Wed, Apr 14, 2021 at 12:32:58PM +0200, Michal Hocko wrote: > [...] >>>> I checked, and when we get there in __alloc_bootmem_huge_page, page-= >private is >>>> still zeroed, so I guess it should be safe to assume that we do not = really need >>>> to clear the flag in __prep_new_huge_page() routine? >>> >>> It would be quite nasty if the struct pages content would be undefine= d. >>> Maybe that is possible but then I would rather stick the initializati= on >>> into __alloc_bootmem_huge_page. >> >> Yes, but I do not think that is really possible unless I missed someth= ing. >=20 > Yeah, it should be fine. I was thinking of a alloc, modify struct pages= , > free back to the bootmem allocator sequence. But I do not remember ever > seeing sequence like that. We do have code like that, though. Take a look at arch/x86/mm/init_64.c:free_pagetable() as one example. But in general, we assume freeing code (buddy, but also memblock)=20 restores the state of the memmap to the original state it obtained the=20 memmap. So if it's properly initialized when coming from the allocator=20 the first time, it should remain properly initialized when re-entering=20 and re-leaving the allocator. --=20 Thanks, David / dhildenb