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 2506DC433ED for ; Wed, 14 Apr 2021 11:09:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 018886103D for ; Wed, 14 Apr 2021 11:09:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233635AbhDNLJc (ORCPT ); Wed, 14 Apr 2021 07:09:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:39826 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbhDNLJ3 (ORCPT ); Wed, 14 Apr 2021 07:09:29 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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