Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp485324pxb; Wed, 1 Sep 2021 03:28:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoVWu7AXnyxoqyM76XCePB5Ifn3XufjDlwEYJ09ELoe22JYGSyxcAYrNYkuM2P3CD1O2vA X-Received: by 2002:a92:c94d:: with SMTP id i13mr22116469ilq.292.1630492121883; Wed, 01 Sep 2021 03:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630492121; cv=none; d=google.com; s=arc-20160816; b=n8WV7RTx0nXMuYKBJwNODLctW4LLx+N1yxDUOW7bVxtIr2mRDBNxmgya1l6WOhJDXu /dTtsNEAzSwoGJ1S8jRPxsFZOzqJ4/1ASjshdWc47NYA9cStFq01b1f7NjWR77f/P/5x wnSBI+ivtygJr3PJLdv0G3PqH8GnnfD09WQgozTMZhpHi57q6AE7bhPWHFawnOHCVlh2 c5OImMBabkTy0F+zKf1kNF1/JYMLP56vI+ZadYv2JGqFOXfV4eyQmX+srX3XmDBa+K3L h/ietq8s0FIVIV9GkqJ6JsUykDBF8/qcaZotJVq4XQ+pgsNiPOKZKxTY2ZQpe8O0azdH 1HHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=YA/eu1n75AvTFrh7eFA15tiGyX9ZJQmZ1I4nxqfhe/o=; b=A7ea5BMqXH0OBdpHVifVnAI9qwMYUEBiqkXdHBDaa85kuBnvwYIei0uCXbauio1/If /5uL+Ykm9UagB7/osxtKlt8Jtg/vtZsQ9uilgiONrgSO5sloBzFyM1/eR4lUTcpxYW73 jVyAbP8az7fGzwNb/bz69OJ27WXyE0STGb+bACWxIQA3OzpZL6ZnxxWQKC2o0qEzTlLG UI1U5Wf/uKLyr25JacWXZcwqPvrT2Ogl4NqEJ5jiaprwXClnyHbxAAvCx3mJtdx28ZUo S/o3/2r9/ma++m0Vwp1zC7VAfC/ebab5Og2INxSBwsrYCYokN4jazy1Kj4tmsubeoOiB hM6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=i8JHGyT8; dkim=neutral (no key) header.i=@suse.cz header.b=z36rLzSQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l30si1306471jaf.107.2021.09.01.03.28.25; Wed, 01 Sep 2021 03:28:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=i8JHGyT8; dkim=neutral (no key) header.i=@suse.cz header.b=z36rLzSQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233692AbhIAK1K (ORCPT + 99 others); Wed, 1 Sep 2021 06:27:10 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:38300 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232997AbhIAK1J (ORCPT ); Wed, 1 Sep 2021 06:27:09 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >