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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45F23C001DC for ; Fri, 21 Jul 2023 11:21:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51ACE2801C4; Fri, 21 Jul 2023 07:21:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CA3D2801C2; Fri, 21 Jul 2023 07:21:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3913B2801C4; Fri, 21 Jul 2023 07:21:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2B5B62801C2 for ; Fri, 21 Jul 2023 07:21:12 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DAFB71A0248 for ; Fri, 21 Jul 2023 11:21:11 +0000 (UTC) X-FDA: 81035377542.24.6EB2792 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id 3137340012 for ; Fri, 21 Jul 2023 11:21:09 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XsjvvGPp; spf=pass (imf27.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689938470; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=73gYU/oLU+jqRRN+vIW8n7/Ak69/Awz3144LXgaBets=; b=rafclm0US7q9z5ovTRSLhQbSlpJpL4/HglL9P80KodiE2zDa56chuOB98xTEFivq8ut+OT dlh6K+rY6NwEQPIfLttgQCqHXsIHwgisWga5+6lfHvXTGbNZBdnEr0Zcqoh4mQiE4Eb5kO /UJvR/84Hvg3aeGWGT23w3eC7LYKkEw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689938470; a=rsa-sha256; cv=none; b=tg/t14dECc1isYq54JdA02o6so7YHHGQ7FvGubHpFRNZ5BsFx9UUEbMiiE/Q+6LjZKKtUW A85L5wWUB+8J3FzPuUvtpDF6buTfXuIuvL4Oak0rKDLmIONDD4hGcU43Yl92KAYXw50D/l 5VcNQEIrk+7eP5iUOKQnjgEwBFXA3U8= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XsjvvGPp; spf=pass (imf27.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 412D36195D; Fri, 21 Jul 2023 11:21:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9653AC433C7; Fri, 21 Jul 2023 11:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689938466; bh=BzBxawFQt5qhrvYcwhomchR2CqahWS/ymIYjhFBgoqg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XsjvvGPpndF9yS3zP1iCeDpNZe+YlaD4Fu+pMZdGApEacI6HEiT8oezvPD51NEBB0 q/4GqelFAXi5yTUMmT4AWwJBF2Y8EpmR799S8I3hmPZKSX1/2lPd9xfQzWm2Mq6fap hEELWiiOsbffDoGOx0cClUBH6q7EKI22E++bbcjJoQxf8Kpk2ReRo+h4nQHoGNj3+x T3q2EVBgKkQ2oGT6/FLcyKIRInUGqFMwSFULPS7z+WUMgFqD67qW8Y83NCyd1cBdIb kKLPEBUxR1h8NQlFU+/2vVnpiPCbzKndDpo8FLvRkGHhqd9Uejmq6rwYO2FfCrQJZW 9rDoyzfh8AYvg== Date: Fri, 21 Jul 2023 14:20:09 +0300 From: Mike Rapoport To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , Mel Gorman , Michal Hocko , Vlastimil Babka , David Hildenbrand Subject: Re: collision between ZONE_MOVABLE and memblock allocations Message-ID: <20230721112009.GP1901145@kernel.org> References: <20230718220106.GA3117638@google.com> <20230719054434.GG1901145@kernel.org> <20230719222604.GB3528218@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230719222604.GB3528218@google.com> X-Rspamd-Queue-Id: 3137340012 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 1zsms343dhiggigub11uwc7skpbfaz3e X-HE-Tag: 1689938469-283783 X-HE-Meta: U2FsdGVkX19awZ2neD5oUsU9nX1ovVy+68CeMbhM8xyFGfZ7sGRWtcBQ51zKyiqdZSsGU7372nDr6tq1xEKqSde4y5WDDooN64paI4NgXpDhQhORY17tHtLkolIJLjYJ0Hw4J9Vh0uGHaCss805n+ZqkuNRC/0/Vf8VJ0vIftvGt6qx7aj0gfoW6rEZG5UWr7nnQVe1bpfhm5OoHWpG1c6LGfn1wvFE7lx2Q+rIvni37OalfMTmBtzU186HEpcjo0BnMyuzPPcPylUnP1rTS9dLF0cI5ybN5HewP7m36GGCwzKeDi3RjBeTGzECAHij2mTCYGtZyljN09MJ9H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loop: owner-majordomo@kvack.org List-ID: 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. -- Sincerely yours, Mike.