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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 4ACF9C433E2 for ; Fri, 10 Jul 2020 14:18:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F277920748 for ; Fri, 10 Jul 2020 14:18:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="QZgu/08O" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F277920748 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8EE948D000E; Fri, 10 Jul 2020 10:18:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 878AE8D0001; Fri, 10 Jul 2020 10:18:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 740518D000E; Fri, 10 Jul 2020 10:18:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id 5FE7B8D0001 for ; Fri, 10 Jul 2020 10:18:31 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 15D2E5848 for ; Fri, 10 Jul 2020 14:18:31 +0000 (UTC) X-FDA: 77022371622.22.cord06_591119326ecf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id D860818038E79 for ; Fri, 10 Jul 2020 14:18:28 +0000 (UTC) X-HE-Tag: cord06_591119326ecf X-Filterd-Recvd-Size: 5500 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jul 2020 14:18:28 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id z24so6623613ljn.8 for ; Fri, 10 Jul 2020 07:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=hqzEtb6lJ3c0NcggDQj1ymj1IRTrDK0wwDPKEgU7aSA=; b=QZgu/08OSA6XnyWA57RMAzQtyx6+bzQmhj9oSowti7m8Jm/o2VZrvNCmaNliGShNFy MlWKqC57fJEIaZYoJ37QYZX6pj088paJDSrjYcwO9diYyJ9X/SOQzpQCKpBFpXSIE7sg IOUXKRRWtsT1qhJjSiHwMUf3kq8PXEf27vBahzoKdWiIkgXRrKl+G5PuT0rMMwmh5eyF dgfMaHaZidY8RlnVQUBpfBEMwlhmuTcd+0CqGX/39ER8fkDMwvYb2zqFTrtPYbnxZYqf A5rWoGBuCQ+8Iu4aIN2BR/b5/L3IsvlfrAAVjk6dzHwxDKyZUr39OMAJODi+Vnkc8R3I +v9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=hqzEtb6lJ3c0NcggDQj1ymj1IRTrDK0wwDPKEgU7aSA=; b=KbDJi41E7BKL4EccOz2S1Kz0nUfMXF4j9qrBbD2Sfj6kUO+d8mW+y/d7HyhITx58ls jlRGF6rlacFG3oRuIfZLwNQhuPhvuiWPg3VyMnokUvEgK0zUI9+dALYrq+QQVuA3aIHJ IX3pNrKxotl3uEAd75EG+gG8WHwHVSQNboAAcVQA7eQqCe8CYTKU44BQPdrV2WzeVb2d 2WejYaYTuYQ/ve8n/Vl7Hf8/ZcWmMiaBeRH+cP2WsKp0EfiVjyzAFXYPnCjnK49gJKRT DmdZR0vgxKywFk290uloh6TVIz6SuP9LCsPHkAVhDxXTMUnAJ0f2m2/1VJ6Whed4tskF K4pA== X-Gm-Message-State: AOAM530uf7/ad9ETFbQ+qnploY0AJoFRPEH6fmYo8aCYmLlqbfztyHK4 O834ETu8m0VnTiRyGvbOze5CEQ== X-Google-Smtp-Source: ABdhPJw4YIBFhRszLIM91bvvWb4kJUAWyZp6wXB7s1GFSa7nu8MbdV3GVah+NY70CPU6gerT+l+1Tw== X-Received: by 2002:a2e:9792:: with SMTP id y18mr36925694lji.172.1594390706942; Fri, 10 Jul 2020 07:18:26 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id z7sm1954324ljj.33.2020.07.10.07.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 07:18:25 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id E1FC910222B; Fri, 10 Jul 2020 17:18:27 +0300 (+03) Date: Fri, 10 Jul 2020 17:18:27 +0300 From: "Kirill A. Shutemov" To: Yang Shi Cc: "Kirill A. Shutemov" , Linux MM , Linux Kernel Mailing List Subject: Re: [RFC] Kill THP deferred split queue? Message-ID: <20200710141827.netxb2rimpge4qkd@box> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: D860818038E79 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000545, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jul 07, 2020 at 11:00:16AM -0700, Yang Shi wrote: > Hi folks, >=20 > 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. >=20 > 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: >=20 > 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; > } >=20 > 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. >=20 > 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? >=20 > The benefit of killing deferred split queue is code simplification. >=20 > 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. --=20 Kirill A. Shutemov