Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp819975pxb; Wed, 1 Sep 2021 10:33:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGElHjksiBhBdicWObHEsGcdQgIe+U5AUP+KEKl56w91z03C1s8wYTpAp+TnNnd6O22w9V X-Received: by 2002:a17:906:d8ce:: with SMTP id re14mr647389ejb.364.1630517633150; Wed, 01 Sep 2021 10:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630517633; cv=none; d=google.com; s=arc-20160816; b=Je9o2BCemdsd60E9X5S7Zs1bcCJGM4y3wtkpx0pl0yyzWffF/v8n5DgvIJgexFfz3W Yk1hMN6tqsZtcvOCeAOFkPfyH0PUXI62Cd9oUsj2K9wjQZP+c2iTTEnG11O8r36kgw/Q qcfPnJaOtwsE6Rx1CUAMAGrxtaUWOmq0Rc1PPfXpYuzXDXy1rSy6veORvpmAQoAeRy1c Yr1mEZmmdKfSJaBgypAMXRzOeVQZeMeNP8YGL59YQLx9wWTcIGjuPbzhMf0My+uo2zRc N21rMKFS1W9k4F/JFrjldLaHDZLsLecFFdHVP1RxXmzUUvxOvV7d+izO93CKmh+sWad1 oUsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sp7XBpDsEWktebv2KujX7GIfrROhmlrwow2+XWTBKgA=; b=wCugbcKLR/OVrG7RYyFO+zwGFikpQMckYsRCTHwoF+P+YrJ/EDVCW5tA5JwkJTu8Nw rvIWzT3PjXsz1egkI7PaYlzlozQ5wIpRyJoBro4lrLbyljltWx1A226NZ0yW/3XQNdmj budflgEnvT8MoVlcKzPWj+Z9cv8zcuA+OG+Wnvmct7Hbp/x8CcsaLHop42A03VsZbNLe oelZcRfeyYVlHKb/UjXFtX3GedY+p3zbnFQeZZoEXBVVfCNnUMYzAO0/NaLduKEoWzQC iTgUxw9dQTfWXgIaW4ZMzJF+13o+rccxJIVnHf7SJqzvljjucg30jbVj2mmsdUrzoJ/D bRmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=S8CnjdOp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si101146edu.602.2021.09.01.10.32.56; Wed, 01 Sep 2021 10:33:53 -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=@gmail.com header.s=20210112 header.b=S8CnjdOp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344533AbhIAR1G (ORCPT + 99 others); Wed, 1 Sep 2021 13:27:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344491AbhIAR1F (ORCPT ); Wed, 1 Sep 2021 13:27:05 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2610C061575 for ; Wed, 1 Sep 2021 10:26:08 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id e21so623364ejz.12 for ; Wed, 01 Sep 2021 10:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sp7XBpDsEWktebv2KujX7GIfrROhmlrwow2+XWTBKgA=; b=S8CnjdOpj1yWZxAPozi1aKqrUt6D2+mKIIRSpT8IaKG6MZnc566+G2YjaELRMbA/EF 8MH0AyCUuSminMsWPbEVWaGoQo5MCZihJcGoP81f0s72L26RhuJrdXLto/fR1JU2UCou gfj3tI4JYQp1O3spGM+JjDbf2P/HOo6dzoYfF3ykrl+k/ijI7jEOyNvw+LpW4M1g9Ilu lmX5yK6G9cHzmhLzJ8viNYPpEnB9ECc5CotfiOyP36zAlSAHsMYdDjloK4Cr+OVXzshs P02GIa3xin37g3+iXJHpZbTHNbp8WmEuDvakWYJfpiV3qsvDp0UgWbwH124JEqDGfGSm 90PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sp7XBpDsEWktebv2KujX7GIfrROhmlrwow2+XWTBKgA=; b=V3IF/7u+gsw++nchYeJ3MWonSoTjFB8c2ODrDf6bn+/UHYuwPCA73GPP9zgzECMd1h tsBAb4KfasN4VEVNnFYnrUjQVUyP+LStTC/VKHmz0hr1Q1H4OoLYCsyJVvSlDmmrSaE2 VlBYB5KvIcPmc/eRqRGS+L/JR8vXxS66oW3WNQaj8aDG0GPJaj4P4SJ7f/x1Tb5bJhMy kf77eGmaIG7JwMiQW6pVybOODZkviVilavOYsgzgEZHP0dSikzeZCZu8GsspnZFOgir9 oGKJIot3xno8/CpdJ+6uBQepTuSmDjbEct9V2fnJG8oGcm2GW2LkfL5zmPbGYq10NnyG CGOA== X-Gm-Message-State: AOAM531bmdZHID9Z35b/zFZ7BlcG5veTufDm/xRIaJBnrnFdJ8iI79Iw TJJCGNn3X24WpORUJfiaTRYOJ5fjm9BhbYmAd4ut+v6gGD0= X-Received: by 2002:a17:906:cc81:: with SMTP id oq1mr608346ejb.25.1630517166010; Wed, 01 Sep 2021 10:26:06 -0700 (PDT) MIME-Version: 1.0 References: <20210817202146.3218-1-shy828301@gmail.com> <20210831233839.afaenhn32nx6m2fq@box.shutemov.name> <07fd6599-88cc-e353-26f0-5de3eeea5b9f@suse.cz> In-Reply-To: <07fd6599-88cc-e353-26f0-5de3eeea5b9f@suse.cz> From: Yang Shi Date: Wed, 1 Sep 2021 10:25:53 -0700 Message-ID: Subject: Re: [RFC PATCH] mm: khugepaged: don't carry huge page to the next loop for !CONFIG_NUMA To: Vlastimil Babka Cc: "Kirill A. Shutemov" , Hugh Dickins , "Kirill A. Shutemov" , Andrew Morton , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 1, 2021 at 3:26 AM Vlastimil Babka wrote: > > 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. Aha, I see. Misunderstood him. I'm supposed that you mean move into khugepaged_scan_mm_slot(). > > >> > >> > >> -- > >> Kirill A. Shutemov > > >