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 190FDEB64DA for ; Wed, 19 Jul 2023 06:14:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2953628002E; Wed, 19 Jul 2023 02:14:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 245C48D0012; Wed, 19 Jul 2023 02:14:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E75D28002E; Wed, 19 Jul 2023 02:14:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id F09988D0012 for ; Wed, 19 Jul 2023 02:14:53 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9CAEF1A018A for ; Wed, 19 Jul 2023 06:14:53 +0000 (UTC) X-FDA: 81027348066.24.3C7EE7C Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf12.hostedemail.com (Postfix) with ESMTP id BEFDA4001A for ; Wed, 19 Jul 2023 06:14:51 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=iJhoCGIY; spf=pass (imf12.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689747292; a=rsa-sha256; cv=none; b=rhWVQACBR2gUCJJC97pd9Ngf8BZn/cX0pkcnx7VwG8rKk0h4aOiWN6kRzKZ3BuUqafoCU1 NjUM970LIqsIfejcDfiXiarP9n98cC5s7Uaf17kkGGFpOzV5uMivSd9NulgYby5jpFdBqO bhXngFJMvD9lpmNy8DniSXmTK8hKk7A= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=iJhoCGIY; spf=pass (imf12.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689747292; 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=/D08qzEWu/7mB48H1swfh+BecNolwUhkRGJESUZ8JEU=; b=xRlEx+r2O9TbSY+/5cjp1QOoiUeukZwC49Pil+NQyTgIX6603fYWp7RDZUiOg6hM0UCRO0 mx1Xa/S2S2y4CeejKN81sHzkDXve90sybqSvQ2xrgCTTirHuyErG6A/pDDqz2hFhCZVCXN iYt3ZM/xMe+vE9HwqBZLzJGm6aSubYc= 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 0ADF5218E3; Wed, 19 Jul 2023 06:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1689747290; 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=/D08qzEWu/7mB48H1swfh+BecNolwUhkRGJESUZ8JEU=; b=iJhoCGIYM7tExD4yQ0N1H01mcecv5NvyEkpcO4WtDNw10MwJPWDHSzPdrTyJQuc0f8JuYl rr/fjRA0ZscX947EfYtVqPuGjZw/1MS2HBuUJ5Z3y/fZPsf37LfPDpRGSQHCDZANPxHnBR pe9jgEmw9cQ3Y6feJqHqckdgjzMb8k0= 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 DF4181361C; Wed, 19 Jul 2023 06:14:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id o8B1M1l/t2QMOQAAMHmgww (envelope-from ); Wed, 19 Jul 2023 06:14:49 +0000 Date: Wed, 19 Jul 2023 08:14:48 +0200 From: Michal Hocko To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mike Rapoport , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230718220106.GA3117638@google.com> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: BEFDA4001A X-Stat-Signature: 84bs1uhx9xdraacfsheah41t5t6keh1o X-Rspam-User: X-HE-Tag: 1689747291-52889 X-HE-Meta: U2FsdGVkX1/RY3EWHvLpuBa2ocqFSr0bPBA2DKhvR9B9BBz96JTr22fbZWGtD3iXvDIsRKh6CIAEmBdEka2OzD3g55WCzR40erwoUrvxZAU1YpGhoNsczomBQGqgtNdqlcr94E6/dXDHwFbjc312o5xwtDVh7C6mQ3wllAItTNr+F1nsKwGc7VlGY7ZhxIjrqWw1fAZlc4qisiHOjuNVvg6+Y5qqexa5rEU20dGd8zlwDCykniLzwotb83J1Odr2mQOSpo4w14/TFUAKIQ6Y9FnxUhuOLDicR4KhBCzlDUYHikMRoE6sT25gJCMlEW4A5IsgfjIDUdd0LbnFiF3hr6xqAod0oQLPPuH4JICsT7mSUlH+EtUqP10aLhhhoDrvavtFGmEBIJzbC82nSW3YSVZcEqRg47k375Vradp/6BJ+5v/5p0h9ho1StBcrGQMgTSFD2mGjDJy8omlYLzMTS/jf55IBOdrzEsKRBzKtnMmQdfbADh8P3WTz1145KByg8s+KnN0PdZpCqSYh8rGZdyhSLGJHEdnA86j1fsjoA17AoUBaZzEyxz5avdI3tvUQ5feXDR55shpU+3taMvTY31YOPKfdqOgR3nUMPAgugADeAg2ffXKf2kLGfphC+PTTp4GuZ4JyflA0RWIIEjEEPZol1yUK2Md4OEzU4Sr1Knp7jHWfGQV3jSOckeD3xtnNomCHD/GukvK6BmNcsjOU0j1lbeCtTmztoGeoGYzzRrrF1mH3AMnlBJZGWNglwUBWoWZpmsDnuNv7x66dcgaaAgsEt1/8PFKLj81HYZdIUm2A5UWlBNvwxd37Xa23ZlLUcO7ppO8EpHlWfJMQ00DYtPmycNBRX0NbMeT04TDtqDYNCGwCV5+5Qx+mDfmnVGt1qVXROkOBcQj09rNXTT6uO9uWHc6bIkmi/ncMRptATasr4ccnwKQmqD8AQWotscotoTXUFi3YyoOXdOdaJ2g bQACcs3P o01ogWXyejbcex+LUOzfi5G2OrWqZuEohx62C1StljI+hc3M3X/dYSMn/rOqT49DosyjUABBeXyPsgczfb2WP139AxxuyGP8JZIBTeytupIDOkLNzqgdmhqid423494E20P2AqtLqoyLcsBqfUH/5x9193akIlVx96a/DUQsLvDObhNM7UfLwzhAybRwWFclulmYx X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 18-07-23 16:01:06, Ross Zwisler wrote: [...] > I do think that we need to fix this collision between ZONE_MOVABLE and memmap > allocations, because this issue essentially makes the movablecore= kernel > command line parameter useless in many cases, as the ZONE_MOVABLE region it > creates will often actually be unmovable. movablecore is kinda hack and I would be more inclined to get rid of it rather than build more into it. Could you be more specific about your use case? > Here are the options I currently see for resolution: > > 1. Change the way ZONE_MOVABLE memory is allocated so that it is allocated from > the beginning of the NUMA node instead of the end. This should fix my use case, > but again is prone to breakage in other configurations (# of NUMA nodes, other > architectures) where ZONE_MOVABLE and memblock allocations might overlap. I > think that this should be relatively straightforward and low risk, though. > > 2. Make the code which processes the movablecore= command line option aware of > the memblock allocations, and have it choose a region for ZONE_MOVABLE which > does not have these allocations. This might be done by checking for > PageReserved() as we do with offlining memory, though that will take some boot > time reordering, or we'll have to figure out the overlap in another way. This > may also result in us having two ZONE_NORMAL zones for a given NUMA node, with > a ZONE_MOVABLE section in between them. I'm not sure if this is allowed? Yes, this is no problem. Zones are allowed to be sparse. > If > we can get it working, this seems like the most correct solution to me, but > also the most difficult and risky because it involves significant changes in > the code for memory setup at early boot. > > Am I missing anything are there other solutions we should consider, or do you > have an opinion on which solution we should pursue? If this really needs to be addressed than 2) is certainly a more robust approach. -- Michal Hocko SUSE Labs