Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp714472rwb; Wed, 26 Jul 2023 01:20:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlGt1YOvMFgzxFU32RuyG8Q2sATh/GUt8T863VF8JnBAtOGh8bHmi+d4Yk+4r9BGLde1BFPj X-Received: by 2002:a05:6a20:2588:b0:137:c971:6a0c with SMTP id k8-20020a056a20258800b00137c9716a0cmr1581014pzd.31.1690359655155; Wed, 26 Jul 2023 01:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690359655; cv=none; d=google.com; s=arc-20160816; b=r0IejzCyl6t3OPI63xHYm57hYv31U+Sp9a45LOeZ50zOGEh5DqFZDHcpDZIzacWZM6 hnKJK3cNXxToEH4fC/tIuOK00eR5xCihLkSzuTR72l2YLXcdVNmidKlzcJc7wA9hjG2u e1KWXFOaap7lTZpqUl/cfq2okixR5/yq0NqLm3xyxEb90WkDTjtvxX5RjTqKxJvELUtB IdfkL3+n11pc+q+ktSWRuuS2KuuXDhQ+IRdLvXePe8gomrfLAQ/JT5lJmdT5yD5GHUrg NBULOEhIMhk1YbDZdkqaKYnCY1nAXA1Wub9f2dxqcAGO3UAhQd82Z7CW4Ce9bf9UEGg7 VPNQ== 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=GONJa8tzUwqKA0Fz+wB3U1k6lRkAIjy3GSK0vW8uCcE=; fh=UJLdpx8n7Gl9FEJb1hC0LwjqjR3dtI89K7ZWYOyozJ8=; b=m1xqE2fn5O/7mo0nHZA/yB6q0H5Jgm/HjNiNa4PYyCaZ55iKX476dhWNPb+gr4/vkp 7tAc8wGmf+584n813AdWvBK1BqHT4k8Dm0jxqVZbV41lY0IYiPHLQy0gFPqNbMT5AiwK s7dDeNyXlPgsSkhJm/aM0ebUIiGbh5JRjCPRSSmdKHhF3PvM6KnSXjhR5xsNRnW4WKtu n8CDVym+dHrxLKDoh1vSsK+XEeZTDttiuCLI5a+9e5K9rrnAlkzjczXJq6aTlcFDxpMm KCnlKyxqJRwIxRwG76EF1LOYqKRJ+NZc2xWUemokUdbNwkvgz/hqlcXUAyzzS35YWIjG 1DYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=joabLHJa; 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 ay36-20020a056a00302400b00686b51c9878si1786348pfb.381.2023.07.26.01.20.42; Wed, 26 Jul 2023 01:20:55 -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=joabLHJa; 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 S232790AbjGZH5d (ORCPT + 99 others); Wed, 26 Jul 2023 03:57:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231329AbjGZH45 (ORCPT ); Wed, 26 Jul 2023 03:56:57 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E96F7299 for ; Wed, 26 Jul 2023 00:49: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-out1.suse.de (Postfix) with ESMTPS id 2A53921D5C; Wed, 26 Jul 2023 07:49:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1690357753; 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=GONJa8tzUwqKA0Fz+wB3U1k6lRkAIjy3GSK0vW8uCcE=; b=joabLHJaqcBy5EOkcJ/+cXWbBd5JWYFFbiCuer3a/tc7fWHsOeV8TEvKSuciFuNDUBiJ6W K1lWHyWK28xzic4hIpByu5BwKQhKgITs56ZfTAF5OlP9c1v3b+qUR3Qqt++Fwd87LBqgjv DkBqFo4aQVUb02Kv1ckXdQQJHrgUOlM= 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 0C0341341F; Wed, 26 Jul 2023 07:49:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EPN5APnPwGTrMAAAMHmgww (envelope-from ); Wed, 26 Jul 2023 07:49:13 +0000 Date: Wed, 26 Jul 2023 09:49:12 +0200 From: Michal Hocko To: Mike Rapoport Cc: Ross Zwisler , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , Mel Gorman , Vlastimil Babka , David Hildenbrand Subject: Re: collision between ZONE_MOVABLE and memblock allocations Message-ID: References: <20230718220106.GA3117638@google.com> <20230719054434.GG1901145@kernel.org> <20230719222604.GB3528218@google.com> <20230721112009.GP1901145@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230721112009.GP1901145@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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 Fri 21-07-23 14:20:09, Mike Rapoport wrote: > On Wed, Jul 19, 2023 at 04:26:04PM -0600, Ross Zwisler wrote: > > On Wed, Jul 19, 2023 at 08:44:34AM +0300, Mike Rapoport wrote: > > > 3. Switch memblock to use bottom up allocations. Historically memblock > > > allocated memory from the top to avoid corrupting the kernel image and to > > > avoid exhausting precious ZONE_DMA. I believe we can use bottom-up > > > allocations with lower limit of memblock allocations set to 16M. > > > > > > With the hack below no memblock allocations will end up in ZONE_MOVABLE: > > > > Yep, I've confirmed that for my use cases at least this does the trick, thank > > you! I had thought about moving the memblock allocations, but had no idea it > > was (basically) already supported and thought it'd be much riskier than just > > adjusting where ZONE_MOVABLE lived. > > > > Is there a reason for this to not be a real option for users, maybe per a > > kernel config knob or something? I'm happy to explore other options in this > > thread, but this is doing the trick so far. > > I think we can make x86 always use bottom up. > > To do this properly we'd need to set lower limit for memblock allocations > to MAX_DMA32_PFN and allow fallback below it so that early allocations > won't eat memory from ZONE_DMA32. > > Aside from x86 boot being fragile in general I don't see why this wouldn't > work. This would add a very subtle depency of a functionality on the specific boot allocator behavior and that is bad for long term maintenance. -- Michal Hocko SUSE Labs