Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3454563iog; Mon, 20 Jun 2022 21:32:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1srui7GohNGnssDdDT68/nLz1/481Qjjvv/tBSBe7i1SaDwxjHHq9Z5gXmQ/zVmr1xEno4N X-Received: by 2002:a17:903:2291:b0:164:95f:b512 with SMTP id b17-20020a170903229100b00164095fb512mr27514088plh.120.1655785921988; Mon, 20 Jun 2022 21:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655785921; cv=none; d=google.com; s=arc-20160816; b=rNgq5UxXF79j2TjXhh12zhuWcWy8R1qT50bRDCd4EzCtBBZgrhmMltWxIT09W18jbR /BYurTLl3TGbRgX2CT45hP8p1SdRFUW29HJVYoUXg+osZ9MaGsvW7CngGgSyCod6W43I 6vOUFE4sp/91Tf0NrS3hcuWVL/+O9f7FdSC11DQG9pa6loUenePL2jbmmv6c9UbUZ2J+ 66skSQkPAu1cDfyoOZh9ijNdMd/PrfD82iruEtTGV7LufpZuBa6XVVH09skug6MTda/E AM46G1ujkmIPAR9UFeUC5GIqtSo4ld0T4+hY1cVTxOsJkWCYgPic4EtEXx6kVy3npvQf G/qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=nIWL9EVYdJEQWQuK0vpXzfqI0MxJEC5kZeDNzNQIaP4=; b=VZiy1yxCklyMwXsbEzBFbPLq2YnqrEB51j/NjRuH2IbTYZ4TIK7ybXbDO+65ZCqDwk 4ORqTOiCyyWyFvH6qs9ZvOkTBpHBudG4w38y6bR8J7llUmqNgExvIKzpVREl1D0ipo2p Hzuoh3S0e+6rVnagTockLQY6A/AMc/18F1PtmYQPqOIETrZb7Z4yJN1LNl6tR8AfwgHy OEBIrxzm7KOD8HHPWg2ah9h525exwEt/7vVNbDkDnEMnq241olfHUZGhJxHl0TDggjVS XLw6GEMdlfjSDC0o3UWxDfggC90JRhoUgSz5/2A3NVrE98mUWZk71m3z8ZLaFelEFehT A8IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tz156sIs; dkim=neutral (no key) header.i=@suse.de header.b=epuDo13d; 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=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il9-20020a17090b164900b001ec8884707esi13769144pjb.61.2022.06.20.21.31.47; Mon, 20 Jun 2022 21:32:01 -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.de header.s=susede2_rsa header.b=tz156sIs; dkim=neutral (no key) header.i=@suse.de header.b=epuDo13d; 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=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240761AbiFUER1 (ORCPT + 99 others); Tue, 21 Jun 2022 00:17:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiFUERY (ORCPT ); Tue, 21 Jun 2022 00:17:24 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F2BC25ED for ; Mon, 20 Jun 2022 21:17:21 -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 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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(-) -- 2.35.3