Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2467204rwr; Fri, 21 Apr 2023 09:13:34 -0700 (PDT) X-Google-Smtp-Source: AKy350bAtt1+ndIQcoMeA9I+hCxTlfPIfOBwQmSB111Nce7t/UOUG9FUGCNPeXyO6j1nkS5a/07a X-Received: by 2002:a17:902:da88:b0:1a2:175a:6153 with SMTP id j8-20020a170902da8800b001a2175a6153mr6991595plx.1.1682093614275; Fri, 21 Apr 2023 09:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682093614; cv=none; d=google.com; s=arc-20160816; b=JPEbAnke1poaM0fYswtpZ0Ao3N726TJ3h/EXvxYJ+nEN3zqvYKvBiZG5azPPbFMDh/ UldHjPppEWBWcjyKwj9Qj5ndiS8lIShu0V+JfaIuUItWOf5DdmA2YeW4SPdhXlG1AqFC +Fr9hNF0UW01DvUYW+HpMRm0YfuzVsRR4LA0jDeke3qWCzl7yCjwQaz6BVf7eAhwUQLl KcdJ+H+Bf0s9c/xa7H3gdV+Wu4e07rCwr/O/w55uaZlG9QoflDy0msbFYk333xAxf83r iGl9uNDJOsFF862IDZncCTIEXQQSOeTkbtKT0sI3ZCBaP0hC/raIrHO1iAvsHj+gFgVr MxRg== 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; bh=pSe7FlNfAH88VThKZ6E3QN9T/eoI3GoV5frRd7Ttpio=; b=QgwfWIqv5+b2TbmL0Yp/zgHV9uAkOagl1O1Bc6z6Yq8po2bTZIy9r3mEdXoK2EK4Pp +ZZErWyUOuelLD55BVImOlDxhI4NIEQWLxuNHEj+G+gvsrh8C0sYCQWi2si631Y1uluI VyIAwYP0zrKZgZHN+lXFV6mHpd8adSy86ZgotvaNRaVSQgE+d/3R5IXDMMpbULUbYX0O bd95GB5mSfI0+2YfwPReO56gLLwDZ/b+kL3icDiu6f6YuIBwKM27sSfHSHjwelraAk2x CRrYb+svP7peVzrd5xMv7G2dLe+8mPbLITUoC/UcsCcAxdG5D8aCH37S+vqRIqsHzBCn uzGw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a170902bd8d00b001a531f29044si4361558pls.521.2023.04.21.09.13.22; Fri, 21 Apr 2023 09:13:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231923AbjDUQMb (ORCPT + 99 others); Fri, 21 Apr 2023 12:12:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbjDUQMa (ORCPT ); Fri, 21 Apr 2023 12:12:30 -0400 Received: from outbound-smtp47.blacknight.com (outbound-smtp47.blacknight.com [46.22.136.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C19E215602 for ; Fri, 21 Apr 2023 09:12:01 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp47.blacknight.com (Postfix) with ESMTPS id 75CEEFACFB for ; Fri, 21 Apr 2023 17:11:59 +0100 (IST) Received: (qmail 6945 invoked from network); 21 Apr 2023 16:11:59 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.21.103]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 21 Apr 2023 16:11:59 -0000 Date: Fri, 21 Apr 2023 17:11:56 +0100 From: Mel Gorman To: Matthew Wilcox Cc: Johannes Weiner , linux-mm@kvack.org, Kaiyang Zhao , Vlastimil Babka , David Rientjes , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC PATCH 00/26] mm: reliable huge page allocator Message-ID: <20230421161156.5jnipnfs4svwwzee@techsingularity.net> References: <20230418191313.268131-1-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Wed, Apr 19, 2023 at 05:11:45AM +0100, Matthew Wilcox wrote: > On Tue, Apr 18, 2023 at 03:12:47PM -0400, Johannes Weiner wrote: > > This series proposes to make THP allocations reliable by enforcing > > pageblock hygiene, and aligning the allocator, reclaim and compaction > > on the pageblock as the base unit for managing free memory. All orders > > up to and including the pageblock are made first-class requests that > > (outside of OOM situations) are expected to succeed without > > exceptional investment by the allocating thread. > > > > A neutral pageblock type is introduced, MIGRATE_FREE. The first > > allocation to be placed into such a block claims it exclusively for > > the allocation's migratetype. Fallbacks from a different type are no > > longer allowed, and the block is "kept open" for more allocations of > > the same type to ensure tight grouping. A pageblock becomes neutral > > again only once all its pages have been freed. > > YES! This is exactly what I've been thinking is the right solution > for some time. Thank you for doing it. > It was considered once upon a time and comes up every so often as variants of a "sticky" pageblock pageblock bit that prevents mixing. The risks was ending up in a context where memory within a suitable pageblock cannot be freed and all of the available MOVABLE pageblocks have at least one pinned page that cannot migrate from the allocating context. It can also potentially hit a case where the majority of memory is UNMOVABLE pageblocks, each of which has a single pagetable page that cannot be freed without an OOM kill. Variants of issues like this would manifestas an OOM kill with plenty of memory free bug or excessive CPu usage on reclaim or compaction. It doesn't kill the idea of the series at all but it puts a lot of emphasis in splitting the series by low-risk and high-risk. Maybe to the extent where the absolute protection against mixing can be broken in OOM situations, kernel command line or sysctl. -- Mel Gorman SUSE Labs