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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 4485AC433E1 for ; Fri, 10 Jul 2020 17:32:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 067EE20725 for ; Fri, 10 Jul 2020 17:32:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sLw6TmCe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 067EE20725 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9DC5C8D0003; Fri, 10 Jul 2020 13:32:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98D288D0001; Fri, 10 Jul 2020 13:32:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87B978D0003; Fri, 10 Jul 2020 13:32:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0163.hostedemail.com [216.40.44.163]) by kanga.kvack.org (Postfix) with ESMTP id 734068D0001 for ; Fri, 10 Jul 2020 13:32:46 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 23E1B181AEF1D for ; Fri, 10 Jul 2020 17:32:46 +0000 (UTC) X-FDA: 77022861132.19.week06_4e0198b26ed0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id EC8F91ACC22 for ; Fri, 10 Jul 2020 17:32:45 +0000 (UTC) X-HE-Tag: week06_4e0198b26ed0 X-Filterd-Recvd-Size: 5472 Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jul 2020 17:32:45 +0000 (UTC) Received: by mail-ej1-f66.google.com with SMTP id a1so6918726ejg.12 for ; Fri, 10 Jul 2020 10:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GyxplQHayEvmvrRHkO0OJLN3lFhVymyo1nylRHB6x70=; b=sLw6TmCekYtu1t+4HXvJDAcDEEqgIVQ5Yz+rND8BHv086zW0gYK3zzTYgrx+4P0P3r m+F+wfKoMU/oBymoiuE1pHgOGlAQKQ5wRGgxzfWlQ2vQPv7K0ygznPgwtCC31QpyHPmT d0yYLhKT/D96ALDbqiLZowWi9n4W0osE5MKF88gz6FMaX+Vj2zyNzVUTzDsD7W/yOZo+ rHWirUpOLYMlrqa31FD38i0TmN5rOy8wBjrKmyvQxhFhKU/UCmHs8CoT7fNRSC1Zk0Id /+TM7PBwnhw//5vnkT9CsS7opth3wxzX1UozYwf1YVkIRz1s3gLf7/L0r1eV8YDHxuuP ZYcA== 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:content-transfer-encoding; bh=GyxplQHayEvmvrRHkO0OJLN3lFhVymyo1nylRHB6x70=; b=uN86p7ZWKEuZykzumR8/R7R2ETzsj7cTN/YvT4WxncLQicEXvUGa32AHoBeub0+kV9 1oK9CJg1ncS6ksB3C+2It+CAVMgfNyy3e56WNu8ZhhnwvCIOphar1LLPXFkWyLSz925e VC82OQ3JEZnsrlDpJYyyLjiAswRPcrSnY9PTZ3rjSWZoKEdHaUICTJ+NXs9cnXc3beLA NXht4R7AAArc/evjErpDLaGZCBd5un6rA027qJLx2PV5XJOOB7wBHJ0FFWMIlpdh/obS U2fLM1ZS9TCyUO+VOGl0WfQMd2DFUgPDKWcdzzZfFxfEoKuMGE/0XW6BFRnGj7TvuHaT tg3Q== X-Gm-Message-State: AOAM533LZxh5ZdxPcwueuXRkTyNCGNs9FDqUOFNJ/sV2XrvHmtBHnDpY 96b2hxTmwxNcsQiX8paR+xhd4ivnM+Uxmf0WRQZVy27dl+A= X-Google-Smtp-Source: ABdhPJyiUicFYVDA5MJbuZfIficFmipK/W9bdoD7Ka6wvWgcgR8ONl2GAArU+JyiC1cRK7vIR/zcIRD+bDWSIOiElDw= X-Received: by 2002:a17:907:2058:: with SMTP id pg24mr65715767ejb.79.1594402364502; Fri, 10 Jul 2020 10:32:44 -0700 (PDT) MIME-Version: 1.0 References: <20200710141827.netxb2rimpge4qkd@box> In-Reply-To: <20200710141827.netxb2rimpge4qkd@box> From: Yang Shi Date: Fri, 10 Jul 2020 10:32:24 -0700 Message-ID: Subject: Re: [RFC] Kill THP deferred split queue? To: "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: EC8F91ACC22 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Fri, Jul 10, 2020 at 7:18 AM Kirill A. Shutemov w= rote: > > On Tue, Jul 07, 2020 at 11:00:16AM -0700, Yang Shi wrote: > > Hi folks, > > > > The THP deferred split queue is used to store PTE mapped THP (i.e. > > partial unmapped THP) then they will get split by deferred split > > shrinker when memory pressure kicks in. > > > > Now the page reclaim could handle such cases nicely without calling > > the shrinker. Since the THPs on deferred split queue is not PMD mapped > > so they will be split unconditionally, then the unmapped sub pages > > would get freed. Please see the below code snippet: > > > > if (PageTransHuge(page)) { > > /* cannot split THP, skip it */ > > if (!can_split_huge_page(page, = NULL)) > > goto activate_locked; > > /* > > * Split pages without a PMD ma= p right > > * away. Chances are some or al= l of the > > * tail pages can be freed with= out IO. > > */ > > if (!compound_mapcount(page) && > > split_huge_page_to_list(pag= e, > > pag= e_list)) > > goto activate_locked; > > } > > > > Then the unmapped pages will be moved to free_list by > > move_pages_to_lru() called by shrink_inactive_list(). The mapped sub > > pages will be kept on LRU. So, it does exactly the same thing as > > deferred split shrinker and at the exact same timing. > > > > The only benefit of shrinker is they can be split and freed via "echo > > 2 > /proc/sys/vm/drop_caches=E2=80=9D, but I'm not sure how many people= rely > > on this? > > > > The benefit of killing deferred split queue is code simplification. > > > > Any comment is welcome. > > The point of handing it in shrinker is that these pages have to be droppe= d > before anything potentially useful get reclaimed. If the compound page ha= s > any active PTEs you are unlikely to reach it during normal reclaim. Thanks. Yes, it looks so. We can't tell if the THP has inactive PTEs or not easily via page_referenced(). It looks the whole THP would be treated as active as long as one subpage is active. > > -- > Kirill A. Shutemov