Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6664843pxb; Wed, 17 Feb 2021 10:04:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJy85CYR9b1DeFNHxOHGHz3jm4Z/Vl8eYZ5WvMASfsgtCI4zESv0EnbNrgpe6OUaAR/fleqZ X-Received: by 2002:aa7:da55:: with SMTP id w21mr95064eds.138.1613585047985; Wed, 17 Feb 2021 10:04:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613585047; cv=none; d=google.com; s=arc-20160816; b=rQ4jepWaoO0sioxBBvVC5mh4+REFyQEMyBhA/O8bYPTb8o7Kh9q2mcrATI41xvAKSX JBAKZXuKsyGQ97kMn30G83S9Co9l+CglM7voI6U9QEH1VMBjuQu1MrZHg+010ByUV8n/ aXrjUQkYXJX0B1evG/SfGm46t4iE7VF1QLsvjtYceBO3jjgQGoZMhZ02Yhl4TyDP8yoR FR6crg8rGZ17G9j8uray9Zyqb1yzQurOk1Z8UhLnL7/0WqCcYOTT3O9WQLs8q1/V8K02 OeRefV3MY6Uh4mzi26d55dhxGSDUQTtAM9BEzqLZWT389oh3V027GkiZAqspP0B15Cf7 T3kQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SETwTKFY3v+orwvahxTNxIwQK9vE3JMDX1v8ML7p/dI=; b=r3EVSAUgx76I8GF7mFbtGVVx8cateMgfX4zmVek45J/rWl8xkiuiNR2C7RDG83ZtKE YaojIASs6NDe1Hq0c+OYop7JFWmZCjhkG27TpCCyDnRLaegmUm6RuOKGEf7QWdYgtF84 gHgmfgBdzcYrhijoLGxmRGLy7tRS41XfCbplwNhsMVjOIPvt15bSDSgTmXjnz6SyyKpV xKkwqtv+CsFvQ5NQRdQPxtux32tqWDmWH2okFYkNyApVMg367eT24f8BiaxapwHi7pw5 JPFkH4//3iGfIF4SW4EL9+VnWxpvY+/fZQaUWimqxqQoCQAC0RQBw2dp33DcZ3DlFfF/ iHJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=N1vhK3c8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw5si1893456ejc.182.2021.02.17.10.03.42; Wed, 17 Feb 2021 10:04:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=N1vhK3c8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233155AbhBQNdJ (ORCPT + 99 others); Wed, 17 Feb 2021 08:33:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:39996 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233061AbhBQNbb (ORCPT ); Wed, 17 Feb 2021 08:31:31 -0500 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=1613568645; 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=SETwTKFY3v+orwvahxTNxIwQK9vE3JMDX1v8ML7p/dI=; b=N1vhK3c89g1umX8EeWbZlXuiLIAD7rTi0xuYJtvpD8m11GMxlzz3PV1pHcythf0W0H3LW5 vVOkYKXZhzctrn0bzDJwrpdKyFB14tgs8hCzm0Mx/vSyrKE5NkvRakLmc9P7YhFFjCDLVE cdlv2ka8MLG3rUmjVvsJ3Xa6jwKDFL4= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1D265B1D7; Wed, 17 Feb 2021 13:30:45 +0000 (UTC) Date: Wed, 17 Feb 2021 14:30:43 +0100 From: Michal Hocko To: Oscar Salvador Cc: Andrew Morton , Mike Kravetz , David Hildenbrand , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] mm: Make alloc_contig_range handle free hugetlb pages Message-ID: References: <20210217100816.28860-1-osalvador@suse.de> <20210217100816.28860-2-osalvador@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210217100816.28860-2-osalvador@suse.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 17-02-21 11:08:15, Oscar Salvador wrote: > Free hugetlb pages are tricky to handle so as to no userspace application > notices disruption, we need to replace the current free hugepage with > a new one. > > In order to do that, a new function called alloc_and_dissolve_huge_page > is introduced. > This function will first try to get a new fresh hugetlb page, and if it > succeeds, it will dissolve the old one. > > With regard to the allocation, since we do not know whether the old page > was allocated on a specific node on request, the node the old page belongs > to will be tried first, and then we will fallback to all nodes containing > memory (N_MEMORY). I do not think fallback to a different zone is ok. If yes then this really requires a very good reasoning. alloc_contig_range is an optimistic allocation interface at best and it shouldn't break carefully node aware preallocation done by administrator. > Note that gigantic hugetlb pages are fenced off since there is a cyclic > dependency between them and alloc_contig_range. Why do we need/want to do all this in the first place? -- Michal Hocko SUSE Labs