Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2822894rwl; Thu, 13 Apr 2023 11:17:46 -0700 (PDT) X-Google-Smtp-Source: AKy350aI3uuNYPWZxjuJ+rqUnqzRfBIWFv1r8xv+Qaa03vGppu7Wq3sUe+IhWVdgLcDcwGsk/2bh X-Received: by 2002:a17:90b:1051:b0:236:a3c2:168a with SMTP id gq17-20020a17090b105100b00236a3c2168amr2836822pjb.33.1681409866196; Thu, 13 Apr 2023 11:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681409866; cv=none; d=google.com; s=arc-20160816; b=rqMZuFUrZZB+PTcQBFBOof3SgDuhdcP+kFiNA5ZQQPt4/z0GaBi9KpY08HadXGn22A 0aORtSznHdoRn5Xkr7LnjA2dIjHAG5Fogj0gwNhCaftk0sE9hHxNyeqRrDWbpZpUE144 JW/3veanCUVMQn1KrNDZyZXyYAgirKRBi9Abl2IC009LxEmthm1LgtlTE7AlHeplBH0Y euZNPWVtof70SnJl0Gd5srFdnijM7bN5A3k+JKiLmJimN1pPuCQDJusDaCJI46mAQuMb x2GV5LWtvEymCJqYme7YQpdb4GRiS/xrTsIfwW3PCEcnakgO8A2nopXNiR+4p4XtUGJX jL9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dvIUkicyd0SkqaB5uD6BHKFL2IXzKJbP500i8yNOqIo=; b=ojCuzrUsC0LKZvggsaahedZTpSzcxWqeir1pMGgPa3RBt0VZnQ4NfTM7oHG74WUNOH FkVw6GpaNZw1K0YYyRcnT692V2ERquu/UQ4LfGTtFigf0XC7UfJRzWM/1JKTTOp/sPd1 evpmcQxZV4Z8994GDbbnMorsf+EIaDifRAX5TyVBu8yIx4yPSvrh1bMWyGO5XGXPQFre 7VNyKewDCUBFim+VYAdp4v0gah3hhdOjT6Ox1QSuMlvBA6qRCm6zZ7ia70wQMT4yXtmG Dti8DT/TWSWJY0tES0BaqaPdjgxeO5E3l39DlutkCzDHxuEei+GQ62iEAgqI0PjljMKg FL+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="dUP4R9a/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y1-20020a63de41000000b00519cded062csi2595350pgi.788.2023.04.13.11.17.32; Thu, 13 Apr 2023 11:17:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="dUP4R9a/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbjDMSMX (ORCPT + 99 others); Thu, 13 Apr 2023 14:12:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjDMSMV (ORCPT ); Thu, 13 Apr 2023 14:12:21 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 437009029 for ; Thu, 13 Apr 2023 11:12:19 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DD6291F45B; Thu, 13 Apr 2023 18:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1681409537; h=from:from:reply-to: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=dvIUkicyd0SkqaB5uD6BHKFL2IXzKJbP500i8yNOqIo=; b=dUP4R9a/iS19V1cWqjLT2hvSSgdv457l3zqZYdcCb6eClfJbCbjkWpp3Ja4pkMRKOToTo3 Yl+7+KMHwMc5mVkBJapeyR4CU7367nUelGOb1fW2173KkR06CqNL8Qt20Sy3j+B5MRz2fX txrfeXbE1KhZZrGOtaZ8HNLgyH7mGtQ= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BC87F13421; Thu, 13 Apr 2023 18:12:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6IywKwFGOGQrKQAAMHmgww (envelope-from ); Thu, 13 Apr 2023 18:12:17 +0000 Date: Thu, 13 Apr 2023 20:12:16 +0200 From: Michal Hocko To: Pasha Tatashin Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, mike.kravetz@oracle.com, muchun.song@linux.dev, rientjes@google.com, souravpanda@google.com Subject: Re: [PATCH v2] mm: hugetlb_vmemmap: provide stronger vmemmap allocation guarantees Message-ID: References: <20230412195939.1242462-1-pasha.tatashin@soleen.com> <20230412131302.cf42a7f4b710db8c18b7b676@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 13-04-23 13:11:39, Pavel Tatashin wrote: > On Thu, Apr 13, 2023 at 11:25 AM Michal Hocko wrote: > > > > On Thu 13-04-23 11:05:20, Pavel Tatashin wrote: [...] > > > This is a theoretical concern. Freeing a 1G page requires 16M of free > > > memory. A machine might need to be reconfigured from one task to > > > another, and release a large number of 1G pages back to the system if > > > allocating 16M fails, the release won't work. > > > > This is really an important "detail" changelog should mention. While I > > am not really against that change I would much rather see that as a > > result of a real world fix rather than a theoretical concern. Mostly > > because a real life scenario would allow us to test the > > __GFP_RETRY_MAYFAIL effectivness. As that request might fail as well we > > just end up with a theoretical fix for a theoretical problem. Something > > that is easy to introduce but much harder to get rid of should we ever > > need to change __GFP_RETRY_MAYFAIL implementation for example. > > I will add this to changelog in v3. If __GFP_RETRY_MAYFAIL is > ineffective we will receive feedback once someone hits this problem. I do not remember anybody hitting this with the current __GFP_NORETRY. So arguably there is nothing to be fixed ATM. > Otherwise, we will never hear about it. I think overall it is safer to > keep this code with __GFP_RETRY_MAYFAIL flag. > > > > > > In an ideal scenario we should guarantee that this never fails: that > > > we always can free HugeTLB pages back to the system. At the very least > > > we could steal the memory for vmemmap from the page that is being > > > released. > > > > Yes, this really bothered me when the concept was introduced initially. > > I am always concerned when you need to allocate in order to free memory. > > Practically speaking we haven't heard about bug reports so maybe this is > > not such a big deal as I thought. > > I suspect this is because at the moment it is not that frequent when a > machine is reconfigured from having a lot of HugeTLB based workload to > non-HugeTLB workload. Yes, hugetlb workloads tend to be pretty static from my experience. -- Michal Hocko SUSE Labs