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=-8.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 6F0A6C432BE for ; Wed, 1 Sep 2021 10:26:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1697C60FC0 for ; Wed, 1 Sep 2021 10:26:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1697C60FC0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AFF536B006C; Wed, 1 Sep 2021 06:26:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AAF256B0071; Wed, 1 Sep 2021 06:26:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 977DA8D0001; Wed, 1 Sep 2021 06:26:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 889F26B006C for ; Wed, 1 Sep 2021 06:26:13 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5490216AE7 for ; Wed, 1 Sep 2021 10:26:13 +0000 (UTC) X-FDA: 78538624626.24.EAC5E78 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf15.hostedemail.com (Postfix) with ESMTP id D0C9FD000097 for ; Wed, 1 Sep 2021 10:26:12 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 71AD022527; Wed, 1 Sep 2021 10:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1630491971; 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=YA/eu1n75AvTFrh7eFA15tiGyX9ZJQmZ1I4nxqfhe/o=; b=i8JHGyT8Gs9o13kDIYZPQ+jVK+hlXuMh2aSFKFm2lxKpMM3f57SZDP7ZBcRIGemht3nyrM j7GkxaSQ7H1bycl3NWKfopFUDzjfdmCjK0Un5eVM6x0QdMzJjUEzxYwVQDTyulMxQsTlx7 HbLiJg8kOiKNkwJ1BcE4587m4QXiANE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1630491971; 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=YA/eu1n75AvTFrh7eFA15tiGyX9ZJQmZ1I4nxqfhe/o=; b=z36rLzSQzIZabs4vlxpWMtyeDiBxjHb8AAZtwMLGASt97Qax9PXhtj17lWv7lPyIg60Ph5 lLdeDSP1VfmZ0WDA== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 4A1771396A; Wed, 1 Sep 2021 10:26:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id k7oeEUNVL2HJKAAAGKfGzw (envelope-from ); Wed, 01 Sep 2021 10:26:11 +0000 Message-ID: <07fd6599-88cc-e353-26f0-5de3eeea5b9f@suse.cz> Date: Wed, 1 Sep 2021 12:26:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.3 Subject: Re: [RFC PATCH] mm: khugepaged: don't carry huge page to the next loop for !CONFIG_NUMA Content-Language: en-US To: Yang Shi , "Kirill A. Shutemov" Cc: Hugh Dickins , "Kirill A. Shutemov" , Andrew Morton , Linux MM , Linux Kernel Mailing List References: <20210817202146.3218-1-shy828301@gmail.com> <20210831233839.afaenhn32nx6m2fq@box.shutemov.name> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=i8JHGyT8; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=z36rLzSQ; spf=pass (imf15.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D0C9FD000097 X-Stat-Signature: 8gyoy969wpyie4azy5gr8rfxrumczddo X-HE-Tag: 1630491972-887131 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 9/1/21 05:46, Yang Shi wrote: > On Tue, Aug 31, 2021 at 4:38 PM Kirill A. Shutemov wrote: >> >> On Mon, Aug 30, 2021 at 11:49:43AM -0700, Yang Shi wrote: >> > Gently ping... >> > >> > Does this patch make sense? BTW, I have a couple of other khugepaged >> > related patches in my queue. I plan to send them with this patch >> > together. It would be great to hear some feedback before resending >> > this one. >> >> I don't really care for !NUMA optimization. I believe that most of setups >> that benefit from THP has NUMA enabled compile time. > > Agreed. > >> >> But if you wanna to go this path, make an effort to cleanup other >> artifacts for the !NUMA optimization: the ifdef has to be gone and all >> callers of these helpers has to be revisited. There's more opportunities to >> cleanup. Like it is very odd that khugepaged_prealloc_page() frees the >> page. > > Yes, they are gone in this patch. The only remaining for !NUMA is > khugepaged_find_target_node() which just returns 0. As Kirill pointed out, there's also khugepaged_prealloc_page() where the only remaining variant does actually no preallocation, just freeing of an unused page and some kind of "sleep after first alloc fail, break after second alloc fail" logic. This could now be moved to khugepaged_do_scan() loop itself and maybe it will be easier to follow. >> >> >> -- >> Kirill A. Shutemov >