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 X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01B33C48BE6 for ; Wed, 16 Jun 2021 17:11:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE87B6024A for ; Wed, 16 Jun 2021 17:11:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE87B6024A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:Subject:From:References:Cc:To:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VHg9peRWdN0EC4QT+18klVm5SUMwror2mPi7Oexh2io=; b=4OzNvUYc1lTVcFDnIqUW14zxZQ LdEuKW1TcbzqZCAahSSGUS4BCbLNH7W/VIso+uUL6L4Y9G2RKZMgtudnKlbwALrn3EURQDRrgnPub UWkFG4AJkxzP12pdhwOeN5ABHMxxLw4NFGRxBecA88rT66em7/gbMaLQmGt7+7Ka4UpL0lmho5M0q h5bCYKu0fddNOxtmJxHkbf45+BNpO5sVhzR5saAspjE8E7qunWUvPN/okNnZtC4LnFPC9AupqN9D7 gTMS4n1PmABtqQ2NCIT5ITtN/G13QOrBfu8wxqSvdteaCss+tnPUX/WIRlxQa1zuiIMf4N3ny4vQn GSu4Qfyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltZ3N-007Fyr-IE; Wed, 16 Jun 2021 17:10:13 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltZ3J-007Fxb-I5 for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 17:10:11 +0000 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 606C521A64; Wed, 16 Jun 2021 17:10:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623863407; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QPGfbGElVJ2SXppTW6aIgd8Twb2wKaHsMDX214lrojE=; b=mriEgvvv4Ne7kbJgIGJTo/dH0YdJ3uhhjjv1hHpbp0mmOWuw8r9YU2tvWj0r5mI+bsI1G8 3upWXKO4cmFF3kx5YeMZk5aenv6HvI66ukxzlRXM9GFbYmvqNBll9XCKJZnNyuEMsmCO1x q0HIzLALFlL6rdPARBnR7QU0YdXg3n0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623863407; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QPGfbGElVJ2SXppTW6aIgd8Twb2wKaHsMDX214lrojE=; b=s76ZnqiB+uCytlEJOQ60UH/A3nnhZNuVPZcGOuB47RpaLjcpvPk81FnpcK3Lae3YQPv6yG kVEzlxW8cv9wgQAQ== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 3C73F118DD; Wed, 16 Jun 2021 17:10:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623863407; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QPGfbGElVJ2SXppTW6aIgd8Twb2wKaHsMDX214lrojE=; b=mriEgvvv4Ne7kbJgIGJTo/dH0YdJ3uhhjjv1hHpbp0mmOWuw8r9YU2tvWj0r5mI+bsI1G8 3upWXKO4cmFF3kx5YeMZk5aenv6HvI66ukxzlRXM9GFbYmvqNBll9XCKJZnNyuEMsmCO1x q0HIzLALFlL6rdPARBnR7QU0YdXg3n0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623863407; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QPGfbGElVJ2SXppTW6aIgd8Twb2wKaHsMDX214lrojE=; b=s76ZnqiB+uCytlEJOQ60UH/A3nnhZNuVPZcGOuB47RpaLjcpvPk81FnpcK3Lae3YQPv6yG kVEzlxW8cv9wgQAQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id 1Hw8Dm8wymDdMgAALh3uQQ (envelope-from ); Wed, 16 Jun 2021 17:10:07 +0000 To: Janghyuck Kim Cc: Catalin Marinas , Will Deacon , Andrew Morton , Palmer Dabbelt , Atish Patra , Gavin Shan , Zhengyuan Liu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20210616083745.14288-1-janghyuck.kim@samsung.com> From: Vlastimil Babka Subject: Re: [PATCH 1/2] mm: support fastpath if NUMA is enabled with numa off Message-ID: <55a95320-f356-86d2-26e4-11407f60de84@suse.cz> Date: Wed, 16 Jun 2021 19:10:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210616083745.14288-1-janghyuck.kim@samsung.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210616_101009_800516_69E02AD9 X-CRM114-Status: GOOD ( 24.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 6/16/21 10:37 AM, Janghyuck Kim wrote: > Architecture might support fake node when CONFIG_NUMA is enabled but any I suppose you mean the dummy node, i.e. dummy_numa_init()? Because fakenuma is something different and I think if someone defines fakenuma nodes they actually would want for the mempolicies to be honored as if there was a real NUMA setup. > node settings were supported by ACPI or device tree. In this case, > getting memory policy during memory allocation path is meaningless. > > Moreover, performance degradation was observed in the minor page fault > test, which is provided by (https://lkml.org/lkml/2006/8/29/294). > Average faults/sec of enabling NUMA with fake node was 5~6 % worse than > disabling NUMA. To reduce this performance regression, fastpath is So you have measured this overhead is all due to mempolicy evaluation? Interesting, sounds like a lot. > introduced. fastpath can skip the memory policy checking if NUMA is > enabled but it uses fake node. If architecture doesn't support fake > node, fastpath affects nothing for memory allocation path. > > Signed-off-by: Janghyuck Kim Sounds like an interesting direction to improve CONFIG_NUMA built kernels on single-node systems, but why restrict it only to arm64 and not make it generic for all systems with a single node? We could also probably use a static key instead of this #define. That would even make it possible to switch in case memory hotplug onlines another node, etc. > --- > mm/internal.h | 4 ++++ > mm/mempolicy.c | 3 +++ > 2 files changed, 7 insertions(+) > > diff --git a/mm/internal.h b/mm/internal.h > index 31ff935b2547..3b6c21814fbc 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -36,6 +36,10 @@ void page_writeback_init(void); > > vm_fault_t do_swap_page(struct vm_fault *vmf); > > +#ifndef numa_off_fastpath > +#define numa_off_fastpath() false > +#endif > + > void free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *start_vma, > unsigned long floor, unsigned long ceiling); > > diff --git a/mm/mempolicy.c b/mm/mempolicy.c > index e32360e90274..21156671d941 100644 > --- a/mm/mempolicy.c > +++ b/mm/mempolicy.c > @@ -2152,6 +2152,9 @@ struct page *alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, > int preferred_nid; > nodemask_t *nmask; > > + if (numa_off_fastpath()) > + return __alloc_pages_nodemask(gfp, order, 0, NULL); > + > pol = get_vma_policy(vma, addr); > > if (pol->mode == MPOL_INTERLEAVE) { > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel