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 CBDECC433EF for ; Mon, 22 Nov 2021 03:42:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D19E6B0071; Sun, 21 Nov 2021 22:42:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 181B86B0072; Sun, 21 Nov 2021 22:42:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0709F6B0073; Sun, 21 Nov 2021 22:42:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0071.hostedemail.com [216.40.44.71]) by kanga.kvack.org (Postfix) with ESMTP id E98FE6B0071 for ; Sun, 21 Nov 2021 22:42:30 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A3A7F184D83F4 for ; Mon, 22 Nov 2021 03:42:20 +0000 (UTC) X-FDA: 78835168398.17.1157F1D Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by imf30.hostedemail.com (Postfix) with ESMTP id B6766E0019B8 for ; Mon, 22 Nov 2021 03:42:15 +0000 (UTC) Received: by mail-lf1-f47.google.com with SMTP id f18so74365876lfv.6 for ; Sun, 21 Nov 2021 19:42:20 -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=rxe8DPCg+uafJ/sYNOrpF2h4ZTaoXE7DFoYKfcxFVJc=; b=A4e5EgXtmamYxQv6yZ/ZCAvXmGDN5/1xd2SQ3B1ZtTWIrwYSMiY2dwTWHNU/yfrZ/r 922YWO9NzPP4rSY/meZSa4DDcRJBlOCDt9XJQp8n70/kgqGct7EVRlR5oPPau0/bQbOQ c2Qzr9hqLtb56Ur9j5LYCjOwvxWhvWNYE2chk2fWg8BMLj263W6IV8/sei2FtshM0Pe1 cU/EVahx+AJaTSvANGXQM5oLuJ1yWF6uYXSWX4OJwY8Jx3TbpfwRerzkgpfm/ncMeg0V avM8N9TXei4WQQhJm+7C3Gd7uRzr0nRj4QRU5FhAtTjN06iy2MEyiiRAiLLuud32fTSE NXiQ== 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=rxe8DPCg+uafJ/sYNOrpF2h4ZTaoXE7DFoYKfcxFVJc=; b=kC+FcuXVFvcsTdc9k4Bhuhx1r8jruD2p3weCQu5aHbwLitbtXXD7V38GWMmx4a8huB d/bECx2TbfMmnOVH2lXaebVrgBKFC+n2OlpV5SifazlbUKXanVi5E4QTrcD0L0FUHu3C PBQNhXDQQXgx2D3usoUu10EkqPCMYH6UHJP86p1jfZys68NtV+ersY25g0crpDK4W73L i+bRalCZbn9373hl78hitKmkAIMwZBI1YDZ9+5dj4qj3TL4E6rK/T6W1CP2zLf5tIv33 a3nrttXMFYET5iuiDSMP+oniNdGEFOaiksplkmxdN/6w2gtUS5R1HgKodYQ337mSiNrk f7MQ== X-Gm-Message-State: AOAM533ehWEp+OPfasN9gNMOf/EeTnncfdQg3ISJ7WoFYKicDJkD8l8Y Qs/KguPjEUq53C3pWqfYtJVzZB6Ix9+TfJj3Ah+ezA== X-Google-Smtp-Source: ABdhPJy23l4y/hncWYk2gEzg4in48kfvM6Ei5MOm26/qaQptkxsqdIo+HuZYIpk001pCAo0twWk8DAfjSTjTaLkGOIg= X-Received: by 2002:a05:651c:545:: with SMTP id q5mr46351182ljp.202.1637552538461; Sun, 21 Nov 2021 19:42:18 -0800 (PST) MIME-Version: 1.0 References: <20211120201230.920082-1-shakeelb@google.com> <20211122005047.ufnyvqlqu55c5trt@box> In-Reply-To: <20211122005047.ufnyvqlqu55c5trt@box> From: Shakeel Butt Date: Sun, 21 Nov 2021 19:42:07 -0800 Message-ID: Subject: Re: [PATCH] mm: split thp synchronously on MADV_DONTNEED To: "Kirill A. Shutemov" Cc: David Hildenbrand , "Kirill A . Shutemov" , Yang Shi , Zi Yan , Matthew Wilcox , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: B6766E0019B8 X-Stat-Signature: knya97wsikjs3xs1oj85izmd3w7sxqww Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=A4e5EgXt; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of shakeelb@google.com designates 209.85.167.47 as permitted sender) smtp.mailfrom=shakeelb@google.com X-HE-Tag: 1637552535-606061 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 Sun, Nov 21, 2021 at 4:50 PM Kirill A. Shutemov wrote: > [...] > > Have you considered impact on short-living tasks where paying splitting > tax would hurt performace without any benefits? Maybe a sparete madvise > opration needed? I donno. > Do you have a concrete example of such short-living applications doing MADV_DONTNEED? I can try to get some numbers to measure the impact. Regarding the new advice option, I did give some thought to it but decided against it based on the reason that we should not be exposing some low level kernel implementation detail to users through a stable API. [...] > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > index 9d27fd0ce5df..a984bb6509d9 100644 > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -1412,6 +1412,10 @@ struct task_struct { > > struct mem_cgroup *active_memcg; > > #endif > > > > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > > + struct list_head *deferred_split_list; > > +#endif > > + > > #ifdef CONFIG_BLK_CGROUP > > struct request_queue *throttle_queue; > > #endif > > It looks dirty. We really don't have options to pass it down? > > Maybe passdown the list via zap_details and call a new rmap remove helper > if the list is present? > We already have precedence on using this technique for other cases but let me take a stab at passing the list through zap_details and see how that looks. > > > > +void split_local_deferred_list(struct list_head *defer_list) [...] > Looks like a lot of copy-paste from deferred_split_scan(). Can we get them > consolidated? I will see what I can do. Thanks for the review. Shakeel