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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C65CC433EF for ; Mon, 27 Sep 2021 10:41:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2D2296101A for ; Mon, 27 Sep 2021 10:41:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D2296101A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9FADC6B0071; Mon, 27 Sep 2021 06:41:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98268900002; Mon, 27 Sep 2021 06:41:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FC526B0073; Mon, 27 Sep 2021 06:41:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 6D15C6B0071 for ; Mon, 27 Sep 2021 06:41:22 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1ED53180CE70B for ; Mon, 27 Sep 2021 10:41:22 +0000 (UTC) X-FDA: 78633011604.37.6685F66 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf29.hostedemail.com (Postfix) with ESMTP id D36D99000163 for ; Mon, 27 Sep 2021 10:41:21 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id g14so15472014pfm.1 for ; Mon, 27 Sep 2021 03:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=k9dfhVa8WXGArQxd4uC/otj1zB4dJvIcYzxwUa5C/4E=; b=QoT3ZFF4ugQruiwS7E5XFSORyz5Nmov5GuWG9OVsPNrkuuqeUaqV7m145MWFi4/BLa U0885TlxBLnajthlt9guvH4SM1UUE0D0CDJRp7++csUMgtDJFVjEObXcLDzuX1gPOQ0k MwxjEFZ5CDiIlBiHTL3I9f/5pTZARLnslWVeAi+LRUzZBuK7H4syUSwUm1cyrHhBNNfl 3/aWn/leiUtxd+xOwIFmChYEnzf30MwhrrQK5WFtwjXKOMyUGrjRkdWoJPvEH3/UQBbT aHdKIGg40nuqiVO+rNBYfKbUSyjWTkBsLWR0TMeWFt80OK9ByLyfW2h7Y77lLD1HoAUS jRSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=k9dfhVa8WXGArQxd4uC/otj1zB4dJvIcYzxwUa5C/4E=; b=wY6bmIWmrRO99JpMhYkzU/Q6MHvJMGbZEA1BRncqjiqvu514Yv4l7oPgKSuXfvQ9np T6INjoirUJRdRJYibLCAg1cFcU1yqAj2KyF2mib688DeVbgWjAR/M0eKhSk8+2PIo1lS LF19BkwK1VKf9KZGsoCKcER2o2LGgBHo2hUEWIPzjgPWcAclnrxj68nMi+oNOZcmTu+x GzhcsygEEmCryNmxdI6Iik1tsFZ6luMMbeLYVpNQSMvnCOK7nBU4qbroa9Kn1K35SPiu d7RrtinKgYOaCVzfUQsaNWXxAQgi+iAykLcw/cKgTQiDTb4gCNgW7458MNL5UHyiiL4y uzDg== X-Gm-Message-State: AOAM531qDafwIsJ3aBlFs9ZKoAzo8aGToo/PkLlI7ZOcR1X0AJJY05kU BzwRwJT1QDFG4rVHURulujY= X-Google-Smtp-Source: ABdhPJzQf6NRl42y9fS/bj1j4AdFeAX4xhGcRWLrwBaZo4mBNoKiBgoChczpGErUH0r0xOxD3+I8MQ== X-Received: by 2002:a63:e446:: with SMTP id i6mr16239207pgk.288.1632739280717; Mon, 27 Sep 2021 03:41:20 -0700 (PDT) Received: from smtpclient.apple (c-24-6-216-183.hsd1.ca.comcast.net. [24.6.216.183]) by smtp.gmail.com with ESMTPSA id r5sm15326341pjd.13.2021.09.27.03.41.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Sep 2021 03:41:20 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [RFC PATCH 0/8] mm/madvise: support process_madvise(MADV_DONTNEED) From: Nadav Amit In-Reply-To: <7ce823c8-cfbf-cc59-9fc7-9aa3a79740c3@redhat.com> Date: Mon, 27 Sep 2021 03:41:18 -0700 Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Peter Xu , Andrea Arcangeli , Minchan Kim , Colin Cross , Suren Baghdasarya , Mike Rapoport Content-Transfer-Encoding: quoted-printable Message-Id: <6E8A03DD-175F-4A21-BCD7-383D61344521@gmail.com> References: <20210926161259.238054-1-namit@vmware.com> <7ce823c8-cfbf-cc59-9fc7-9aa3a79740c3@redhat.com> To: David Hildenbrand X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: D36D99000163 X-Stat-Signature: 4t91o9tud3635iy7tjbts91y9koccjmh Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QoT3ZFF4; spf=pass (imf29.hostedemail.com: domain of nadav.amit@gmail.com designates 209.85.210.176 as permitted sender) smtp.mailfrom=nadav.amit@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam06 X-HE-Tag: 1632739281-588391 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 Sep 27, 2021, at 2:24 AM, David Hildenbrand = wrote: >=20 > On 26.09.21 18:12, Nadav Amit wrote: >> From: Nadav Amit >> The goal of these patches is to add support for >> process_madvise(MADV_DONTNEED). Yet, in the process some (arguably) >> useful cleanups, a bug fix and performance enhancements are = performed. >> The patches try to consolidate the logic across different behaviors, = and >> to a certain extent overlap/conflict with an outstanding patch that = does >> something similar [1]. This consolidation however is mostly = orthogonal >> to the aforementioned one and done in order to clarify what is done = in >> respect to locks and TLB for each behavior and to batch these = operations >> more efficiently on process_madvise(). >> process_madvise(MADV_DONTNEED) is useful for two reasons: (a) it = allows >> userfaultfd monitors to unmap memory from monitored processes; and = (b) >> it is more efficient than madvise() since it is vectored and batches = TLB >> flushes more aggressively. >=20 > MADV_DONTNEED on MAP_PRIVATE memory is a target-visible operation; = this is very different to all the other process_madvise() calls we = allow, which are merely hints, but the target cannot be broken . I don't = think this is acceptable. This is a fair point, which I expected, but did not address properly. I guess an additional capability, such as CAP_SYS_PTRACE needs to be required in this case. Would that ease your mind?