Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1633917pxb; Wed, 9 Feb 2022 00:42:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUvMbTpIZNb1wfsXC30d/SdblQDcGSwjFss8Kn2X9S5Hf6KsMsgiTIk7vtpdOQI8WokXDv X-Received: by 2002:a05:6a00:2486:: with SMTP id c6mr1189380pfv.21.1644396122409; Wed, 09 Feb 2022 00:42:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644396122; cv=none; d=google.com; s=arc-20160816; b=zVR07hHPLaoDierg7Mo0LJGjY276+yZReJa8ICjCEs6szmiuPuRsU5X3FPbmurNk15 NXhpQ2qatE7SdLThI6EDe8gltvsl8G0X6snphN5c1CW6zy3n2k8DBjitYhMaRp7XAuIZ 2PQxfUmRsDnNe2r5jxFN0eRDs6vy0GU8Hj1QruqqKNu36mYk5vvlXiBkGoORyetrzrYm +c9JIhBKcg2LshHme9EqT6iOE6QGghad+4ue3pJvmNZUJZFQ2P5l1dUPLMCyuvFwcBFd fkhC/5tIKOKyOZD3OLJBiUA8ciwly9HPXNBa4HoJdleBQ3LY2HAvpPywgZzWlwATn6wD zBcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=teClNrONiYXVnmCwa1h1q0ixCqq3xRiV2+FUHXxwnkg=; b=gU1gTDhIp6gelcLvd0IvcQVbisETtxtRxjKC4Kyl1caNdakTa1j3pfcPflEhhJaX9I cJHhCG9z5quQI+20fiKUfgTHCnqUL4Cos5Qst4AVKRDGlKQH3JAFDHGd/fEPan3Ct9Lz wfkcpqY6or4/GUBk/sLsLc4bKmVSgKmFWVQwThuKxTPLHV1F9ELuBih1bJ795O4JTMzQ 4emkE73xR1VYloGoreeaIDIfWFw35NNEsn1sNpQ4VSJmp+P8BlCGK/pBpvCSRPVzNal/ FTQ1f/wT7TlhimdpajQBVGQnYtsO5MN5nbcZRgqG6wXmDgAuVcRb4XfZuWoC5gCOEUiV sfyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XJr+XUCn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id kk17si5566784pjb.176.2022.02.09.00.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 00:42:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XJr+XUCn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0DC17C034025; Wed, 9 Feb 2022 00:40:02 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352740AbiBHJBn (ORCPT + 99 others); Tue, 8 Feb 2022 04:01:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352732AbiBHJBl (ORCPT ); Tue, 8 Feb 2022 04:01:41 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00D6CC03FEC0 for ; Tue, 8 Feb 2022 01:01:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644310900; 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=XJr+XUCnlX3t14kvQdmGWTGKPMg/sEMcoLKkpkChaA+qcpIg4EvAtjZlqqayhSIgmwIWjy rry18MLDincWHsjXykq1nUjxPSY6C7tTZAQVWlJCRcLMnnirqOL0SgCjEfPEk1b2oopkb4 cAt/A7sSsjpnE3qZxHww4anMZ26gm5E= 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-mdkJlDz9Ore6Q7Kp9E1Y6Q-1; Tue, 08 Feb 2022 04:01:36 -0500 X-MC-Unique: mdkJlDz9Ore6Q7Kp9E1Y6Q-1 Received: by mail-wm1-f70.google.com with SMTP id u14-20020a05600c210e00b0037bddd0562eso271513wml.1 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=3ObVY7AuNl+zN56J5kjZIl0zSju+uSs3092KbFCZgbdRCsqIgs2x/7MNAfw8B8an79 CklP08wGi7WRJsu5lF9cxREhaGVPVvskT3E/sw56xMHubeY1J2/IDwYcwnfO6WEB+EhJ Nsa+DQYcpq6D1xMbd5PLQ1whopKMLg/vAzuqegmUzaNNsxK85d/gWxdjjsWvGutPKFra Eaa2Gz7ckZ3s7ca5nApHRpnmP+2zMmsGxqkLUnDWLdF/yFlekLvh/1DWKh4QTHoWLLnJ Lb6W9RnuUSebGe7NSRPWdM5RjdlIzxu4mUk2NxleiK0HoeKDBS3EhneyPGP+w60WT3Re Pq9g== X-Gm-Message-State: AOAM5313++uzD7YTSfMTbMNAy7iKMhKhEhHgC6xmNGvDccVW8lxh5B/E 8Y/2MOhRfbL/9IG10+9Dj7TK3INoYRtjlge3wgv0Hh8qz6WahDYo1LpiQVi447zSPk0Hg0/3QTM VOLD9QV4U4V5awdLu6Oeq9aos X-Received: by 2002:a05:600c:35c5:: with SMTP id r5mr179779wmq.195.1644310895805; Tue, 08 Feb 2022 01:01:35 -0800 (PST) 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 Content-Language: en-US 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: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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