Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp132652lqp; Sun, 9 Jun 2024 21:03:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyCghy7nLO2L7XMYis8gHPOvDnn9DYTzYc2Aw8m7PasC2MLR7G01WT4Sww1P6V9ElWMcFJQ/G6oxrGT7MR/FykQdLHMixAS4nAKOWIgA== X-Google-Smtp-Source: AGHT+IER1CrlVWN8TmY4rPi5tjwsg6uMCfnAy/ciCLe4rpKs2YyMmnygOHdYgzjK54J14t5L36j7 X-Received: by 2002:a05:6a00:2e11:b0:705:9abf:a405 with SMTP id d2e1a72fcca58-7059abfa6a6mr1318871b3a.9.1717992235066; Sun, 09 Jun 2024 21:03:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717992235; cv=pass; d=google.com; s=arc-20160816; b=UQwYaoGm6pQFPmGJZb8P/5QQwzr/EGPDsypecrV2oJWiMs4BcWEuQv/n7FCeXdBR2o MnOdU9SCINx1kRt+o1RPJQ6G3ksz8AJsIK47oDAZarLFuraWIt3NExG/uLXtrMk7jBIQ jmpfDGMMVouXKP48UwtVgJcDN/kYFNJ7jtOAa0qcIPS5OBvG1CoHZnBPxcK48fCNNbE4 H4OQFwyWGXKlNLYQ5VjLB0ymcCUTi80hevSlPKr9qgHLd9jCAyZip0zC5JFF4/NWY13L 65A5ga5aznLWMI5n1WdXBEDArxRjtdU49ErOBhMg80K32wo6edXHBjpYoHYF3RZa2jo0 txKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=IYHZUWJMx20LtuFCKKBR+s4SdF/zVxwDIU/zuxJyVpA=; fh=opXV1WEp03kbeubOZloyb10FoNtntQdRllRWblbVMRI=; b=gxn0FEJ8vS+ls77ekP8LlPxfjporze4Ums7k1wIIsOJjNLkTfge3ChC2oDtsFIrim5 jTc4Wao0TS7TGBbuR0wkxSDCuJmdqcJNw53+KLseOyNamflYdylCwn36ZvroB7XxZTX7 notoQUx4kL56XkEkZ117Pv4bF59tCcXh49uRbBZB6XUvUzI3EZNEncJSnZm5M5ePp6G5 WzgZE6SC5dFdTh7G/tMLn5vMZYw2W7JLti8aCuIGL98cNBtBDOGaC5Js1Rky1iJf/EvC +/bmdGiaAEM0P8u8eT8p+Lz9PAkJ9ZaAdaNnHxgpMsmqkMfChMf8VE+G2iz8aQJ75jdX E72A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ydtYYv4z; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ydtYYv4z; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-207608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de208317f0si7193673a12.175.2024.06.09.21.03.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 21:03:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ydtYYv4z; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ydtYYv4z; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-207608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0FD97B21449 for ; Mon, 10 Jun 2024 04:03:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66567AD53; Mon, 10 Jun 2024 04:03:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ydtYYv4z"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="2VfRPhmr"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ydtYYv4z"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="2VfRPhmr" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1465C6FC7; Mon, 10 Jun 2024 04:03:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717992224; cv=none; b=tEsQVJDQ09OPb6myZcx7zf12crTohkW32TojwlmffVi/SfWEdYtyFvN/Ed+TZjl5YuLuzPi58Q5Pbg2/NPxyxMUYcCm/sSgTg9wwH/E7v0Gzn8088OUFrN4xcEAsyOFrTdE4Y7JsPRMBCT9oBzaUHTPhv6Ksplgk4NXiPJY57sI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717992224; c=relaxed/simple; bh=GChWdvz367o5jaGDbpYnIiP5MM27bWYnZ96439DZOVE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pXhnArazV7CtHWx5K8Gn/d5ePF2FWWs5k9Fq0lY3NwyTs4FBUVKg8tKQJlKH2ySOgGQHf2zhv+4Efdr1QA9T8DrbSUtcmSqmITY+iFREROIFcljs+XWP+1INjkICc+ytCMIEnF3JSZ3tFrC+sb699JlFw/9mJUu8ec7T1i59U8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ydtYYv4z; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=2VfRPhmr; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ydtYYv4z; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=2VfRPhmr; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 48E781F74B; Mon, 10 Jun 2024 04:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1717992221; 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=IYHZUWJMx20LtuFCKKBR+s4SdF/zVxwDIU/zuxJyVpA=; b=ydtYYv4zpnWoA+DOEizDfb0xxwSoFgVJdNwaHwsZ4KNXXr0McZcQoDjm0TnP6modKw7qU/ YU6A1x5Wb6Mc5i5eAKt/8AnZNi+ROMDh3WDQz74dIE+RuF5EAw2jT5VaieXlP6Lpkd0vmq E86gqlWw/GGQiz4G8sn557CdigPAhQM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1717992221; 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=IYHZUWJMx20LtuFCKKBR+s4SdF/zVxwDIU/zuxJyVpA=; b=2VfRPhmrW05hUtLnVJUcfs9KMJfRv9vz9QyGoBqjvqYUGpchjhJed480Cqm/I/F3MSoXT2 Q9/kUhFsd2NbvbBw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1717992221; 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=IYHZUWJMx20LtuFCKKBR+s4SdF/zVxwDIU/zuxJyVpA=; b=ydtYYv4zpnWoA+DOEizDfb0xxwSoFgVJdNwaHwsZ4KNXXr0McZcQoDjm0TnP6modKw7qU/ YU6A1x5Wb6Mc5i5eAKt/8AnZNi+ROMDh3WDQz74dIE+RuF5EAw2jT5VaieXlP6Lpkd0vmq E86gqlWw/GGQiz4G8sn557CdigPAhQM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1717992221; 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=IYHZUWJMx20LtuFCKKBR+s4SdF/zVxwDIU/zuxJyVpA=; b=2VfRPhmrW05hUtLnVJUcfs9KMJfRv9vz9QyGoBqjvqYUGpchjhJed480Cqm/I/F3MSoXT2 Q9/kUhFsd2NbvbBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2ECBB13A85; Mon, 10 Jun 2024 04:03:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id K/XmCBx7ZmbzEgAAD6G6ig (envelope-from ); Mon, 10 Jun 2024 04:03:40 +0000 Date: Mon, 10 Jun 2024 06:03:38 +0200 From: Oscar Salvador To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, xen-devel@lists.xenproject.org, kasan-dev@googlegroups.com, Andrew Morton , Mike Rapoport , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Alexander Potapenko , Marco Elver , Dmitry Vyukov Subject: Re: [PATCH v1 1/3] mm: pass meminit_context to __free_pages_core() Message-ID: References: <20240607090939.89524-1-david@redhat.com> <20240607090939.89524-2-david@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240607090939.89524-2-david@redhat.com> X-Spam-Flag: NO X-Spam-Score: -4.30 X-Spam-Level: X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[23]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo] On Fri, Jun 07, 2024 at 11:09:36AM +0200, David Hildenbrand wrote: > In preparation for further changes, let's teach __free_pages_core() > about the differences of memory hotplug handling. > > Move the memory hotplug specific handling from generic_online_page() to > __free_pages_core(), use adjust_managed_page_count() on the memory > hotplug path, and spell out why memory freed via memblock > cannot currently use adjust_managed_page_count(). > > Signed-off-by: David Hildenbrand All looks good but I am puzzled with something. > + } else { > + /* memblock adjusts totalram_pages() ahead of time. */ > + atomic_long_add(nr_pages, &page_zone(page)->managed_pages); > + } You say that memblock adjusts totalram_pages ahead of time, and I guess you mean in memblock_free_all() pages = free_low_memory_core_early() totalram_pages_add(pages); but that is not ahead, it looks like it is upading __after__ sending them to buddy? -- Oscar Salvador SUSE Labs