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 EDCB8C433EF for ; Sun, 21 Nov 2021 05:26:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 430256B0071; Sun, 21 Nov 2021 00:25:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3DF486B0072; Sun, 21 Nov 2021 00:25:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A7856B0073; Sun, 21 Nov 2021 00:25:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id 188B26B0071 for ; Sun, 21 Nov 2021 00:25:52 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AED4A89080 for ; Sun, 21 Nov 2021 05:25:41 +0000 (UTC) X-FDA: 78831800292.05.256BCC1 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by imf29.hostedemail.com (Postfix) with ESMTP id 6E57B9001A80 for ; Sun, 21 Nov 2021 05:25:39 +0000 (UTC) Received: by mail-lf1-f52.google.com with SMTP id z34so63994291lfu.8 for ; Sat, 20 Nov 2021 21:25:41 -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=X4pH5l/YZV5sg5PI2rPGcwYaytwkxVMA0LOTHcYQe2U=; b=bArzITR3je/r66rDQ7SZtkKWpDlr63MpCcrcB3bfQwAdlv4yOP5NM5wx2A3XToSJcY Dwzwnk+icBr9Gn/IIdK/H/v0WX5Y28vw9BMKt0h4JACHtqbcgJsQuBOClWuDmTIHmARC J1L2L0e0L1Q1jBK4HtS0ZmtUfOs21ZbXKesAh4rA2eJy7/JXc/Y2YGUuQWDwwjQENrzo KcuFcFtPQKhm/BFsQlvAmBjuE1RlYKlQpj0MoIJjPXKo/6BOmzF/YsCoghoOUHU3foUw QGgjoU1hENtCAFRwKFdEUrTL7T9JrzSK4Y3PCU79rtKtDI+isMJrTiFpE4vFwo4GLd7z LeRw== 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=X4pH5l/YZV5sg5PI2rPGcwYaytwkxVMA0LOTHcYQe2U=; b=HYHxx+HqswDl1qnL5LiQ8RlFNnbv/NaAI7g9HVC5IinRqifuujSR9B3xbujhKB+0qx HhkeSxNs/M85sIwG1v7zJa7hCFw6S89VLtTX7JjtWALId7U7D8NHSCWHSbTVFV5B/Fiq DOBZrAiFzu1d4+GxcBAs+OWgRiQDWokP6kiAJfH6/6onAqIpOPWOYVhBSoP3aIkyGPwi Bck+NRCGMUVe308hv3u3/pSwA0OJ7ljdihWudTu215xqkUqo7QdWL6dfGIzvmyEvOag6 07G5aseo6umdOrJBR1yxoH1fMj0fsiwsDI2pk1crbxQkYuK+a1G0kjqvuQ7Wt3vqOT+T HtXw== X-Gm-Message-State: AOAM531Uop90rhgp7H0YSn43KxJTej9kqfo05VGD48267yPol0CXQ7dR pG8XUuqyCipHF2XWvSoRmvXp2nHEGNId2J4SYB9u7g== X-Google-Smtp-Source: ABdhPJx0hg1xPtGgP7bsOKI/crWchsvO76PM1qgyi4ppfnWtVhWlnzyMA3NDpjFSTkkLYeLT1WT772R2NW+wHLYC7sE= X-Received: by 2002:a05:6512:5c2:: with SMTP id o2mr46048931lfo.8.1637472338463; Sat, 20 Nov 2021 21:25:38 -0800 (PST) MIME-Version: 1.0 References: <20211120201230.920082-1-shakeelb@google.com> In-Reply-To: From: Shakeel Butt Date: Sat, 20 Nov 2021 21:25:27 -0800 Message-ID: Subject: Re: [PATCH] mm: split thp synchronously on MADV_DONTNEED To: Matthew Wilcox Cc: David Hildenbrand , "Kirill A . Shutemov" , Yang Shi , Zi Yan , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 6E57B9001A80 X-Stat-Signature: iz5cqu474zngrgw8hranu1pu4tciqm8a Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=bArzITR3; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf29.hostedemail.com: domain of shakeelb@google.com designates 209.85.167.52 as permitted sender) smtp.mailfrom=shakeelb@google.com X-HE-Tag: 1637472339-790490 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 Sat, Nov 20, 2021 at 8:35 PM Matthew Wilcox wrote: > > On Sat, Nov 20, 2021 at 12:12:30PM -0800, Shakeel Butt wrote: > > This patch let such applications not worry about the low level handling > > of THPs in the kernel and splits the THPs synchronously on > > MADV_DONTNEED. > > I don't mind the synchronous split, but I have concerns about the > implementation. I don't think it's worth another pointer in task_struct. Are you concerned about the size of task_struct? At least on my config this additional pointer was just filling the holes and not increasing the size. I can check a couple other configs as well. > It's also the case that splitting is likely to succeed, so I think a > better implementation would try to split and then put the page on the > global deferred list if splitting fails. Actually this is what this patch is doing. See the second loop in split_local_deferred_list().