Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp480924pxa; Thu, 27 Aug 2020 07:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPmTJXmTWwMbbHyCaVnjjUOAF9OBKVZtyDRXWaDZU5mbDx9cxDzgRMl9lPnXeM/5XJDJB9 X-Received: by 2002:a17:906:f107:: with SMTP id gv7mr20688837ejb.519.1598538853122; Thu, 27 Aug 2020 07:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598538853; cv=none; d=google.com; s=arc-20160816; b=om3p0R5m5+eGhz/GXGd2dhnoJ31O7dRnYDlPB+BPYfTDMBaOBcCz9TTE3dD21ACbG+ KSiRXxuHItPfmS8619E6hT2ktdH+AE4BwfuTuYvs4/rjeJ0HwPVYH7gKYgaEWagBUFwV BiKO/UkkDwI4bLvlHgPCrdNKMna0i/72RChP/Fg6SouyDkjFpelffOPwVb2B0CzyK+1Q vB6/wQt8ICIGAKMLTjQzI0l5Ve2Qp0poXLlo5zIlSFBYZ14WOe7RQRPI5gPtYekZOdiE Jl7m30aPlmkFQL+h6NG6HdZdlEkkQ5it+nhhPm4lQq5EVzsh7DdPXJ/RNq2gz7ealWCS bzbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7mpQ/nk/cQTcpyoT6ZpURcUTf2Am8I9UP1TziC1aL0c=; b=htI/CnENYm9qIEqiqw8ZeyEjdUdXAE7X/1fpI3QE5lEnZH2+qkNPZDIMAwNS1/pfSe dIfzzbyH9MWGI2eluYWoqhswMuB3iIq1zF9skQ23FcFtJlgjPUQ+I/WbX3xJbD6ssh3I sDe/vzT82cRULGK0Vkwwbk1it8aRUmq0Tk9Lrd01CKjAo+dqQ5eHSEfiX/Gi82ZCaA2Q /Hf87KWSRrwjEVGoStzWF4PWlKDJjccxPQvHcYEOip35wTGeXUfZnLZXZ/c6o0X38NWX CHlKs11rBEF1xTz6ULuvSgwqRoHF8Qrfpdh1MiUdJWzy3dMpb1bZjryCgAVkdXQ9g8Tk zghw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KRWGGRmd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mv6si1422576ejb.698.2020.08.27.07.33.50; Thu, 27 Aug 2020 07:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KRWGGRmd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727036AbgH0O1E (ORCPT + 99 others); Thu, 27 Aug 2020 10:27:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:37819 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727860AbgH0OQk (ORCPT ); Thu, 27 Aug 2020 10:16:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598537756; 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: in-reply-to:in-reply-to:references:references; bh=7mpQ/nk/cQTcpyoT6ZpURcUTf2Am8I9UP1TziC1aL0c=; b=KRWGGRmdeZvSM/iGMdxX6h5WNobFAacXFq32l9dXBw+dx1NcND7GKDBklp50H9rSAmP+R8 VIPfg/g3FXSGCKYnQGFMceWntxhaUvTZJbAIieOyP7J2FE67Uy1LlWQTC2u21ijyF2y0OT m1p2t0xEw1CDq3rrY9+dHVFS3IYcoUo= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-562-JMfYdDJHMOO7743Y3S4CbA-1; Thu, 27 Aug 2020 10:15:52 -0400 X-MC-Unique: JMfYdDJHMOO7743Y3S4CbA-1 Received: by mail-qk1-f200.google.com with SMTP id v16so4903579qka.18 for ; Thu, 27 Aug 2020 07:15:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7mpQ/nk/cQTcpyoT6ZpURcUTf2Am8I9UP1TziC1aL0c=; b=op8q5z2ASx/2e6ZKTRJhqKq3KQx1jxoQVbbMdRQq1suvtRGwxC8A0K6grTvS65o0UI n43KHFzLKyZuOIa0/0iZux1lVndTttv/QQzZQGMCk/r1VgLQUEWehmrGUrxkK85UMIrP 2t2oA5d90s5W5bCVdzRrH1AsXep9PaOkktyBE67E3vm2clrSp5S49lqv4AUcxF9pL1KK nlJf1LlXSL8FgxnGXzvJZ3m9fhCzK1Hre7PDAj2xSFtc8jFDDTNz8KOyNzQeNSOurRZl QOnDlh/tk09B7hL10iX3+Os8Xsm2X4YYFM+jd+kv/+7kppZfSDjJs6s+iXF86tTxy2x+ 7lPg== X-Gm-Message-State: AOAM533ekcf6tqhyvaYvrK//JzTSJGl0NqMUdR+HAK7ixh2RRplCk5ev el68QWwjsxBY8EbNoRUsITG5dzEwDq8StE6YywLaV3DTLmea/2NP5PM0Yve5MlxTdu+374Nk0v7 +H1CDf/QL71wKzIkyNDpq10kB X-Received: by 2002:aed:3bb8:: with SMTP id r53mr3174844qte.289.1598537751928; Thu, 27 Aug 2020 07:15:51 -0700 (PDT) X-Received: by 2002:aed:3bb8:: with SMTP id r53mr3174815qte.289.1598537751620; Thu, 27 Aug 2020 07:15:51 -0700 (PDT) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-11-70-53-122-15.dsl.bell.ca. [70.53.122.15]) by smtp.gmail.com with ESMTPSA id y24sm1795095qtv.71.2020.08.27.07.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 07:15:50 -0700 (PDT) Date: Thu, 27 Aug 2020 10:15:49 -0400 From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: "Maya B . Gokhale" , Linus Torvalds , Yang Shi , Marty Mcfadden , Kirill Shutemov , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton Subject: Re: [PATCH 0/4] mm: Simplfy cow handling Message-ID: <20200827141549.GA6059@xz-x1> References: <20200821234958.7896-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200821234958.7896-1-peterx@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 21, 2020 at 07:49:54PM -0400, Peter Xu wrote: > This is a small series that I picked up from Linus's suggestion [0] to simplify > cow handling (and also more strict) by checking against page refcounts rather > than mapcounts. > > I'm CCing the author and reviewer of commit 52d1e606ee73 on ksm ("mm: reuse > only-pte-mapped KSM page in do_wp_page()", 2019-03-05). Please shoot if > there's any reason to keep the logic, or it'll be removed in this series. For > more information, please refer to [3,4]. > > The new mm counter in the last patch can be seen as RFC, depending on whether > anyone dislikes it... I used it majorly for observing the page reuses, so it is > kind of optional. > > Two tests I did: > > - Run a busy loop dirty program [1] that uses 6G of memory, restrict to 1G > RAM + 5G swap (cgroup). A few hours later, all things still look good. > Make sure to observe (still massive) correct page reuses using the new > counter using the last patch, probably when swapping in. > > - Run umapsort [2] to make sure uffd-wp will work again after applying this > series upon master 5.9-rc1 (5.9-rc1 is broken). > > In all cases, I must confess it's quite pleased to post a series with diffstat > like this... Hopefully this won't break anyone but only to make everything > better. > > Please review, thanks. > > [0] https://lore.kernel.org/lkml/CAHk-=wjn90-=s6MBerxTuP=-FVEZtR-LpoH9eenEQ3A-QfKTZw@mail.gmail.com > [1] https://github.com/xzpeter/clibs/blob/master/bsd/mig_mon/mig_mon.c > [2] https://github.com/LLNL/umap-apps/blob/develop/src/umapsort/umapsort.cpp > [3] https://lore.kernel.org/lkml/CAHk-=wh0syDtNzt9jGyHRV0r1pVX5gkdJWdenwmvy=dq0AL5mA@mail.gmail.com > [4] https://lore.kernel.org/lkml/CAHk-=wj5Oyg0LeAxSw_vizerm=sLd=sHfcVecZMKPZn6kNbbXA@mail.gmail.com Is there more comments for this series on either reviews, or suggested tests to carry out (before a broader trial)? Thanks, -- Peter Xu