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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC3B3C433F5 for ; Wed, 24 Nov 2021 21:20:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 71A026B0078; Wed, 24 Nov 2021 16:19:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A2F86B007B; Wed, 24 Nov 2021 16:19:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 543CD6B007D; Wed, 24 Nov 2021 16:19:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0166.hostedemail.com [216.40.44.166]) by kanga.kvack.org (Postfix) with ESMTP id 45D506B0078 for ; Wed, 24 Nov 2021 16:19:58 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 116A889B25 for ; Wed, 24 Nov 2021 21:19:48 +0000 (UTC) X-FDA: 78845090772.11.AA9833A Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by imf28.hostedemail.com (Postfix) with ESMTP id A6A459000504 for ; Wed, 24 Nov 2021 21:19:47 +0000 (UTC) Received: by mail-lj1-f180.google.com with SMTP id v15so8309290ljc.0 for ; Wed, 24 Nov 2021 13:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0xsrVI4JVeqO+9evyHHI7Dch8GDpLynkfJrUX3WfwWA=; b=ZQ3U+e6o580w9XuoqCcUmNSrIjZCNv56VNDhqZgcfSwtzSiVXi3xn+d7/YHBTUfCLU 727ozilp1jt2Ag+wfwiN6FAp8gEHB54JvmEtelCYS20dg40MYLasm/HkZUbLYumkWRSn MQbIP9DWpKEEZIY5O5GNDobrAxBS9F/VX6UMBtbWi++GyjvCL/xoV+doRGtbDX6mlNPS Y4jZ32rNsDXK/YsSK7G3CArf+kxV6K15fV2tkCxmoQLLFiHWZJhd100uqRbma2nhw4Kd Auc6/n6EaQXC4Sn7s+zn/VUJtFuy1p9qXCNMWxeYuiQtarQ7cxholZRPMcH4SGicZhIh 2H/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0xsrVI4JVeqO+9evyHHI7Dch8GDpLynkfJrUX3WfwWA=; b=zBDcUxJ42segkWcJVuTz+JbtzrUSBzJN/VSdXKjnzgpfFSyCIMWBMiWK6rfsIo5pPP af9dMYgxzoYeiGhUK3XVStzaQoy3vCHrv0DC3FkPlDbeJsyFu7RKCQK53QEfvk85zYAQ FirCmTjPRtNjIgNLVALyDoP5Nd0wVH7ns2Ea1kxLGidNOJ02oW1rQEnuTONE/WY0rjnX cn2BZxWe1Rh17kobiKSOw2AH2YgpKHucruvlrB1HhEY/T4LivtcqXtlNPJFtStG9F556 dypKv+7g8fOV8iJD1+Y569AQmxco32+qngGhZvmbGJvVXWWvA7cMtZAoku3fM2IzcYUf sNrQ== X-Gm-Message-State: AOAM532AGTr7CvA5qDJoqKOnNdTOHrK8x3rA14m5NkZ/7bVYtze6KfpF 5jZIx0pjRtZTZOaYWe5YoMCqErSH63Z+StPYHT3YvA== X-Google-Smtp-Source: ABdhPJyZLD14H2CRCtTVGIlBNE4A2k1CBfekEwunZAdta6YLqyKVm1Pu+KD6aAlAOqEYcYn1MPQspt0Q4DW/ovgW4zA= X-Received: by 2002:a2e:9699:: with SMTP id q25mr19401273lji.6.1637788785831; Wed, 24 Nov 2021 13:19:45 -0800 (PST) MIME-Version: 1.0 References: <20211123190916.1738458-1-shakeelb@google.com> <20211124201238.3xzpy2b5zcv7j23s@box.shutemov.name> In-Reply-To: From: Shakeel Butt Date: Wed, 24 Nov 2021 13:19:34 -0800 Message-ID: Subject: Re: [PATCH v2] mm: thp: update split_queue_len correctly To: Yang Shi Cc: "Kirill A. Shutemov" , David Hildenbrand , "Kirill A . Shutemov" , Zi Yan , Matthew Wilcox , Andrew Morton , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A6A459000504 X-Stat-Signature: gcdw3pd5xx53h3p593hw3jgyocp9wdsr Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ZQ3U+e6o; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of shakeelb@google.com designates 209.85.208.180 as permitted sender) smtp.mailfrom=shakeelb@google.com X-HE-Tag: 1637788787-501336 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 Wed, Nov 24, 2021 at 1:17 PM Yang Shi wrote: > > On Wed, Nov 24, 2021 at 12:44 PM Shakeel Butt wrote: > > > > On Wed, Nov 24, 2021 at 12:12 PM Kirill A. Shutemov > > wrote: > > > > > > On Tue, Nov 23, 2021 at 11:09:16AM -0800, Shakeel Butt wrote: > > > > The deferred THPs are split on memory pressure through shrinker > > > > callback and splitting of THP during reclaim can fail for several > > > > reasons like unable to lock the THP, under writeback or unexpected > > > > number of pins on the THP. Such pages are put back on the deferred split > > > > list for consideration later. However kernel does not update the > > > > deferred queue size on putting back the pages whose split was failed. > > > > This patch fixes that. > > > > > > Hm. No. split_huge_page_to_list() updates the queue size on split success. > > > > > > > Right. This is really convoluted. split_huge_page_to_list() is just > > assuming that if the given page is on a deferred list then it must be > > on the list returned by get_deferred_split_queue(page). The > > interaction of move_charge and deferred split seems broken. > > Because memcg code doesn't move charge for PTE mapped THP at all. See > the below comment from mem_cgroup_move_charge_pte_range(): > > "We can have a part of the split pmd here. Moving it can be done but > it would be too convoluted so simply ignore such a partial THP and > keep it in original memcg. There should be somebody mapping the head." > > BTW, did you run into any problem related to this? > No, just reading code to see if I can share code for the sync splitting of THPs.