From patchwork Tue Jun 21 04:17:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 12888670 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 878FBC433EF for ; Tue, 21 Jun 2022 04:17:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A178A6B0072; Tue, 21 Jun 2022 00:17:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C7578E0001; Tue, 21 Jun 2022 00:17:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B5F66B0074; Tue, 21 Jun 2022 00:17:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 7DD9D6B0072 for ; Tue, 21 Jun 2022 00:17:22 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4817A34176 for ; Tue, 21 Jun 2022 04:17:22 +0000 (UTC) X-FDA: 79600933524.31.2F6F3A6 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf28.hostedemail.com (Postfix) with ESMTP id AABDDC0019 for ; Tue, 21 Jun 2022 04:17:21 +0000 (UTC) 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 202CE21F36; Tue, 21 Jun 2022 04:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655785040; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=nIWL9EVYdJEQWQuK0vpXzfqI0MxJEC5kZeDNzNQIaP4=; b=tz156sIsSo/UFoRCVe7HhhGUshcKwuSga/5PixBI7OLvsis6OsAIjGDCB30EvPrh6amKP+ A4grCF1sglip7hZqE+lE1sUbl1gfq+G9nv621DCPjwvh42dSrYct/x6/SYp4ruVwxLeC1w TB7hYvg8U6pOBmvLOg/8TmrH3ULzfzs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655785040; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=nIWL9EVYdJEQWQuK0vpXzfqI0MxJEC5kZeDNzNQIaP4=; b=epuDo13d/ZZSVjA2fizAUvPFZAsxO/WQjBvz5lOxcyUrQDRkGj2xRv02pWa158zpDMq7pZ 2+zpFLMA7V5DH5Dw== 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 A99E313A37; Tue, 21 Jun 2022 04:17:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AAyQJk9GsWLLGwAAMHmgww (envelope-from ); Tue, 21 Jun 2022 04:17:19 +0000 From: Oscar Salvador To: Andrew Morton Cc: David Hildenbrand , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH v2 0/2] Minor memoryhotplug refactoring Date: Tue, 21 Jun 2022 06:17:15 +0200 Message-Id: <20220621041717.6355-1-osalvador@suse.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=tz156sIs; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=epuDo13d; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf28.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=osalvador@suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655785041; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=nIWL9EVYdJEQWQuK0vpXzfqI0MxJEC5kZeDNzNQIaP4=; b=0W9adHCa1tRCWeSHLaYD2xSronMe9gz+EMSUxf8CvN3xWZCGH32fb6U2m38rBUgRdw3OUL 8etH3DJ9MS5NlYz5UufzuqEqFl3eDVDTqt2DuP6cXm6o+gpjbD3viUKqGJRTc86wtgxYOQ SAiI+Isx9Sw3lr4L8F5JYFJRKKLX9b4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655785041; a=rsa-sha256; cv=none; b=J03C9QienBPLn3EBXaNMoVzo78Ab5LrP6PoBuPpO1uqmKKK1kU0jJN9sM5DZ9iXB/eqsg+ 6YU1CSS6Cm70hCWcqSPqmB0RLRQU9XzBUrLdj0kEj4MAo8aDvqiEUAiO5adS0E05tIxt0+ kzvuyLYyIn5Np9AtZzdlVS0o/rJVr7Y= X-Stat-Signature: qawin6q8b6d5ewxngaqnfhdjomd7b69i X-Rspamd-Queue-Id: AABDDC0019 X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=tz156sIs; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=epuDo13d; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf28.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=osalvador@suse.de X-Rspamd-Server: rspam10 X-HE-Tag: 1655785041-35176 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: Hi, these are a few cleanups. The first one is to spare us with some operations when dealing with empty nodes, and the second one is to refactor memory-hotplug code taking advantatge of the fact that we initialize all nodes (empty or not) when booting the system. That gives us the chance to only have to reset some fields when the node goes offline again. More information can be found in the respective patches. v1 -> v2: - Addressed feedback from David Oscar Salvador (2): mm/page_alloc: Do not calculate node's total pages and memmap pages when empty mm/memory_hotplug: Reset node's state when empty during offline include/linux/memory_hotplug.h | 2 +- mm/memory_hotplug.c | 54 ++++++++++++++++------------ mm/page_alloc.c | 65 +++++++++++----------------------- 3 files changed, 53 insertions(+), 68 deletions(-)