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 51D4CC433EF for ; Tue, 8 Feb 2022 09:01:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAB9E6B0071; Tue, 8 Feb 2022 04:01:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A34BD6B0078; Tue, 8 Feb 2022 04:01:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8ADE16B007B; Tue, 8 Feb 2022 04:01:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 77F056B0071 for ; Tue, 8 Feb 2022 04:01:39 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3529E2054F for ; Tue, 8 Feb 2022 09:01:39 +0000 (UTC) X-FDA: 79119019518.05.D9228F4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id AAF5A100005 for ; Tue, 8 Feb 2022 09:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644310898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=teClNrONiYXVnmCwa1h1q0ixCqq3xRiV2+FUHXxwnkg=; b=bf7cogF3HrQDqtOSLekVbR7gw4VxnAcMzP+tZnXIEf5hIZ5jWpKI0nZdSihLJynnRr8I9l EMbH4/lwyjxmbfTF9w+wKojiO0X404cdhE/cvjtxHgmbrYnb8I0g1IGHO9MFPJ4aYspSqP R+EpyZ2154WJA3O83YNFUWtMppfGj38= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-yMyuX4VuPs68Z8Gc4iYRDw-1; Tue, 08 Feb 2022 04:01:36 -0500 X-MC-Unique: yMyuX4VuPs68Z8Gc4iYRDw-1 Received: by mail-wm1-f70.google.com with SMTP id i8-20020a1c3b08000000b0037bb9f6feeeso767059wma.5 for ; Tue, 08 Feb 2022 01:01:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=teClNrONiYXVnmCwa1h1q0ixCqq3xRiV2+FUHXxwnkg=; b=aDJbY0Tfr0dqSrjqAp0ab3x0ds2myl+YS9MYYt20eeHjkIyUyjMxtpV/R6zc2Asmeh bxwr96wkf7/sjZsNP9i3SBo4pjfX0FpqCEJSEM64dOzRkdYhO36pIl57SWyrQP8Cc4GF Ms2wNNbcUqplczmw85RJaWeWs0CCQCcqhdjA+Hey7efjJiBNG6WmFYW5BLh94Dok8xer 3Li5iGxmN3+LvoPXAjCOKr23krjJc/LxxaLieA5r9kypE8cIzTb8Nu3dg///Ru23GGBD adJTD8ewSPdkjxegJBhdOBzqWJ8Ju77xzfW2OjCYduDbJMWJlYrtRtA6W/670ebo3Qhi 1PeQ== X-Gm-Message-State: AOAM533WpcrswU9GKkM6RGl6Efr8LRF42kD7vKafdKs8F69/QJnPE+ZQ BUVgJE2KV9y4wWBAxIs6kMoNZOLNhC2Fo6M47gBaKc7V+BwoZPOu6Tji+GQq6o9bC6mNJA0dnPD TbZ+e+QVd+rk= X-Received: by 2002:a05:600c:35c5:: with SMTP id r5mr179778wmq.195.1644310895804; Tue, 08 Feb 2022 01:01:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrVaaJIU8wUcTZyPhODOggfPw3ee0UatWxMSdfB4lHP3hYokLnrCC49IDRTBsBo3R5aJzqjQ== X-Received: by 2002:a05:600c:35c5:: with SMTP id r5mr179756wmq.195.1644310895582; Tue, 08 Feb 2022 01:01:35 -0800 (PST) Received: from ?IPV6:2003:cb:c712:a800:a1a0:a823:5301:d1af? (p200300cbc712a800a1a0a8235301d1af.dip0.t-ipconnect.de. [2003:cb:c712:a800:a1a0:a823:5301:d1af]) by smtp.gmail.com with ESMTPSA id e13sm13822419wrq.35.2022.02.08.01.01.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 01:01:34 -0800 (PST) Message-ID: Date: Tue, 8 Feb 2022 10:01:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] mm/damon: Add option to monitor only writes To: Pedro Gomes Cc: SeongJae Park , Steven Rostedt , Ingo Molnar , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, John Hubbard References: <20220203131237.298090-1-pedrodemargomes@gmail.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam11 X-Rspam-User: X-Stat-Signature: t6m78ggh57edcbktoxsdkiz9c489k8se Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bf7cogF3; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf14.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Rspamd-Queue-Id: AAF5A100005 X-HE-Tag: 1644310898-317224 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 08.02.22 03:05, Pedro Gomes wrote: > On Mon, Feb 7, 2022 at 7:32 AM David Hildenbrand wrote: >> >> Just like clearrefs, this can race against GUP-fast to detect pinned >> pages. And just like clearrefs, we're not handling PMDs properly. And >> just like anything that write-protects random anon pages right now, this >> does not consider O_DIRECT as is. >> >> Fortunately, there are not too many users of clearreefs/softdirty >> tracking out there (my search a while ago returned no open source >> users). My assumption is that your feature might see more widespread use. >> >> Adding more random write protection until we fixed the COW issues [1] >> really makes my stomach hurt on a Monday morning. > > I was not aware of these issues. > >> Please, let's defer any more features that rely on write-protecting >> random anon pages until we have ways in place to not corrupt random user >> space. >> >> That is: >> 1) Teaching the COW logic to not copy pages that are pinned -- I'm >> working on that. >> 2) Converting O_DIRECT to use FOLL_PIN instead of FOLL_GET. John is >> working on that. >> >> So I'm not against this change. I'm against this change at this point in >> time. > > I agree. I will wait until the COW problems are solved to send this patch. > > I'll put you on CC once I have something ready to at least handle pinned pages (FOLL_PIN) as expected, to not get them accidentally COWed. -- Thanks, David / dhildenb