Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3279446pxk; Mon, 21 Sep 2020 09:32:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMxRSv7Z99ZjR6XlD2r8e1T0hzwOWPPxZ/JVroJmKDK9dKFAJdlUNkZfng3gywYonbsk1x X-Received: by 2002:a05:6402:17b6:: with SMTP id j22mr433916edy.377.1600705962282; Mon, 21 Sep 2020 09:32:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600705962; cv=none; d=google.com; s=arc-20160816; b=iHVxdY9SjViBykyS+tIBO1reED+f5qvvfvJ0CGRoJZpzf+xC3uxeskCZVr9S6kfZa9 j5LALOKB8F3n7KU0vPAiiG7B+E0bIxIUwOmR7Z/kEOiUo/RDVUqVbdGYx/60Jn1KIkyq iTeAUVWR8wTyODLs03V5J3uJ4UYO03gdJrDjQp23dtqNyZsFcJNnumULaR0HxVcroreI KRXwLzQAIKM3+ERabtK+2Pd2KgUhnf5NvfST1MfgRXBIMr9AcQmOjOSEcGvJc+wuYhhE JAx6ygckB4I31r6F1c5Vko/TItif1UNW5NXqJDa2arAQ4XvTARE8Ads70tAFAmoD36fK DXbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YCM4fKtgeOMOirEKB7YXGA+aIYpRp3p+tCGoFRLfrkc=; b=kOidL3tAxREcBoJQxh7SRNTfXoih7zWbK5McD0J8Q3ZuVD7aJv+s68RmnT20WMTKIO LszBZtyie7woODkOs6XVbRaulZWjGHHYoOxCUgmic4t2E26nsrtk4zPtQAjlGy9cwhFf ibBwQqxNSxGeVZgbgXhpBtMojguXtTJbHnzUw1RTlMS2gMdoHoWTv9PYmIjt0DhFKmXk EaLfUFhGCPhIbEA23hEKtstjTsOU8WGepjFm5/rzq4WyogUMIkRJZQEwoST33mbrBERN RL+tpeY9xX/6tX4Tlv7MHYVlfO26yKjKC2B3s1N5N8024F2LJ9iBxTndW2fJsgeZCqbp jcew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EBmfATeK; 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 d17si8303394edx.591.2020.09.21.09.32.16; Mon, 21 Sep 2020 09:32:42 -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=EBmfATeK; 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 S1728026AbgIUQbV (ORCPT + 99 others); Mon, 21 Sep 2020 12:31:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22557 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726950AbgIUQbV (ORCPT ); Mon, 21 Sep 2020 12:31:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600705879; 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=YCM4fKtgeOMOirEKB7YXGA+aIYpRp3p+tCGoFRLfrkc=; b=EBmfATeK1oTkwL10gSyX5k1DEbhL06jkIByCpMMfsSIvLwwOQ7Gaw4YNN08D+8sH4NJhQJ NWjrhaXkRWi3fBuhUqykwta9oBu/9R4uSDJ2WtmTwByZy2znQEME34p8qTzu7Sblv6TXJc ntn1soSEvItvPYCfyeMycz9+XSexing= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-111-ouIWdwa4NP6RtCpqDEncEA-1; Mon, 21 Sep 2020 12:31:16 -0400 X-MC-Unique: ouIWdwa4NP6RtCpqDEncEA-1 Received: by mail-qv1-f72.google.com with SMTP id k14so9439263qvw.20 for ; Mon, 21 Sep 2020 09:31:16 -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=YCM4fKtgeOMOirEKB7YXGA+aIYpRp3p+tCGoFRLfrkc=; b=mMi+DBBe3qAZ2l1f9q9PsC52eVMlUlHxTvp189PwfDQZPuvAMrqjUcxD0XKkX10KIw zAqTMkzgCWjGhxcHgBhk2OW+5JmhL1SbD01aWHbc7nwPVrtgsOCjeM5MGqxo/rJXDsSk PstmndsT4r6EvHm6sgSmAlh0BnJDzaflWACXYitB1OIR9+YSol7xf0J1HLDFoNTUafIO WAxe1/+em3giUaFRaD2BGg9TXxGgBOn7AHGyaybz0UkDj6ukdj3Zri1UTaHlHv4dhOf5 gWnnHekh3CaVmABk0zvE6hf9+QMEYle9UBnu8BZ8ff3uchUJg+fMRS1okJ2+pWnTCskb Ee9w== X-Gm-Message-State: AOAM533AwPc1t38xq5C0nKI4jurYlFWWyUKiVU+weQMaJSgoslqQg3BX W0BR8jfUXjiYyQpq1XpdZXBXT6ItXOtKp1EKdQQUBYwN2z/GNDhQ5VVQzd2PCABjzd0wWvobLts ZR4U/jLNni3kLk6CmxBCuW0ry X-Received: by 2002:a05:620a:1f2:: with SMTP id x18mr623976qkn.150.1600705876037; Mon, 21 Sep 2020 09:31:16 -0700 (PDT) X-Received: by 2002:a05:620a:1f2:: with SMTP id x18mr623933qkn.150.1600705875707; Mon, 21 Sep 2020 09:31:15 -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 t11sm10214526qtp.32.2020.09.21.09.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 09:31:14 -0700 (PDT) Date: Mon, 21 Sep 2020 12:31:12 -0400 From: Peter Xu To: Michal Hocko Cc: Christian Brauner , Tejun Heo , Linus Torvalds , Jason Gunthorpe , John Hubbard , Leon Romanovsky , Linux-MM , Linux Kernel Mailing List , "Maya B . Gokhale" , Yang Shi , Marty Mcfadden , Kirill Shutemov , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification Message-ID: <20200921163112.GF5962@xz-x1> References: <20200916174804.GC8409@ziepe.ca> <20200916184619.GB40154@xz-x1> <20200917112538.GD8409@ziepe.ca> <20200917193824.GL8409@ziepe.ca> <20200918164032.GA5962@xz-x1> <20200921134200.GK12990@dhcp22.suse.cz> <20200921144134.fuvkkv6wgrzpbwnv@wittgenstein> <20200921145738.GN12990@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200921145738.GN12990@dhcp22.suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2020 at 04:57:38PM +0200, Michal Hocko wrote: > Switching the order wouldn't make much of a difference right. At least > not for memcg where all the accounted allocations will still go to > current's memcg. I think I'll make it simple to charge the parent directly just like what we do right now. I do expect that the charged amount could be quite some when there're a lot pinned pages on the parent process, however hopefully it's acceptable as it's still a very rare case, and proper MADV_DONTFORK upon pinned pages on the parent process will eliminate all these charges too. I actually already prepared some patches. It's definitely bigger than expected due to the complexity that we held page table locks in copy_one_pte() when trying to break the cow pages. I don't know whether it would be proper any more for rc, especially the ending of rcs. Anyway I'll post them out soon after I did some basic tests, because I think that's something right to do irrelevant to when it will be merged. Thanks, -- Peter Xu