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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 31667C433B4 for ; Wed, 14 Apr 2021 11:09:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C3F51613C3 for ; Wed, 14 Apr 2021 11:09:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3F51613C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5C61C6B0071; Wed, 14 Apr 2021 07:09:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 576FC6B0072; Wed, 14 Apr 2021 07:09:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 418CF6B0073; Wed, 14 Apr 2021 07:09:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id 286846B0071 for ; Wed, 14 Apr 2021 07:09:09 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C9554180AD822 for ; Wed, 14 Apr 2021 11:09:08 +0000 (UTC) X-FDA: 78030700776.34.228DF70 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf26.hostedemail.com (Postfix) with ESMTP id E6CEE40002CD for ; Wed, 14 Apr 2021 11:09:03 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1618398547; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A4XaU4bKYdWfQby7bgwaXDNXIbPwsiRHLSOMBCceY2I=; b=R+ggOnLW2VETOpmWnn8lSrH82PleP7/FcY+IVP5t1CFbnxl2qyU21bFQP3bKmpVmAvXIlR Sm/EwKhP1p3ujRe1HnzhUzV5b+NBODprpzeWqFUc6YrYMupklNP7OCbgJk1KeWio/Izldh X/cYiFh/UhWaAVUPj52XyQ0dvWgOYTs= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3576CAF45; Wed, 14 Apr 2021 11:09:07 +0000 (UTC) Date: Wed, 14 Apr 2021 13:09:06 +0200 From: Michal Hocko To: Oscar Salvador Cc: Mike Kravetz , Andrew Morton , Vlastimil Babka , David Hildenbrand , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 3/7] mm,hugetlb: Clear HPageFreed outside of the lock Message-ID: References: <20210413104747.12177-1-osalvador@suse.de> <20210413104747.12177-4-osalvador@suse.de> <20210414074132.GB20401@linux> <20210414100147.GD20886@linux> <20210414104953.GF20886@linux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210414104953.GF20886@linux> X-Stat-Signature: b8no8axaeh38yo1j7aess4wc8b17uniy X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E6CEE40002CD Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618398543-630449 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 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 undefined. > > Maybe that is possible but then I would rather stick the initialization > > into __alloc_bootmem_huge_page. > > Yes, but I do not think that is really possible unless I missed something. 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. Bootmem allocator users tend to be simple, allocate storage and either retain it for the life time. Other than PageReserved bit they do not touch metadata. If we want to be paranoid then we can add VM_WARN_ON for unexpected state when allocating from the bootmem. But I am not sure this is really worth it. -- Michal Hocko SUSE Labs