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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18A64C43465 for ; Mon, 21 Sep 2020 16:31:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 987BF20757 for ; Mon, 21 Sep 2020 16:31:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eTIlKj2u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 987BF20757 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1E029900097; Mon, 21 Sep 2020 12:31:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1693F90008B; Mon, 21 Sep 2020 12:31:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFE7E900097; Mon, 21 Sep 2020 12:31:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id D70C990008B for ; Mon, 21 Sep 2020 12:31:24 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9F466181AC9CB for ; Mon, 21 Sep 2020 16:31:24 +0000 (UTC) X-FDA: 77287608888.26.soup57_2d0b04627146 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 66ACD1804B660 for ; Mon, 21 Sep 2020 16:31:24 +0000 (UTC) X-HE-Tag: soup57_2d0b04627146 X-Filterd-Recvd-Size: 5497 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Mon, 21 Sep 2020 16:31:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600705883; 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=eTIlKj2ub1+nWMAmAkzghsfLXbm2gD5ys+EW4uPividrMjvjh3Vq5BQGfDwZXZigjJrESq j9TmXF8WTGon8Q4L9hfl9PQ+XvqafFSUncVciqY/se48WrC2/BxBbrFuGlZfSt3rzCyYbq BrY7YbpPgYI0eVz1GP5quORFedvLtcE= 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-509-bLpwM7xTNtqlum0X4McPdA-1; Mon, 21 Sep 2020 12:31:16 -0400 X-MC-Unique: bLpwM7xTNtqlum0X4McPdA-1 Received: by mail-qv1-f72.google.com with SMTP id t4so9194474qvr.21 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=VU8nnzMhUhCfGfK/BQVfGB2eDONkxb2p8O456DRZ9H0K1g0WYhp15Qtaf1O1M1ZUc1 oVF1D/DWPjSKpwg0zQQHXLnoTIMF5qxA9gyetMRqMkfT00v+CJkkBMz5jDoTEok1wSqb 5HWTJUQgwlW023GmF2yhbiKtNkwVG5h/7jOPjOO2fkKFxnY7Sk2zMXi7xyejVqqc8zkU xlgj3enxu72fk+8JkA7+lbr7OkEQa18U4Ax1Mg/TUzSfv3HPVnnVrcFuZP5flZKIrRum SlbEoJoUbwnF8RbXvGPHQJotelEjp4YXpQvQE2VIECe+lklHzdXqdRfuiEm5VcHSloOd 0gOQ== X-Gm-Message-State: AOAM5339ZAR1IwGt7LHAGxINC3Vo8bSIEAT+WQgt86erASNhoqQUhg/c eta44zWlibOULcmhSbr14IPtHpihbc2QRI07bXLxZro5NrKISB7U/9uts6q5pv94v1s3sdrkn/5 f2KHNGy0Qv2E= X-Received: by 2002:a05:620a:1f2:: with SMTP id x18mr623972qkn.150.1600705876031; Mon, 21 Sep 2020 09:31:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5i8SjLtXMnIDDkKkJKM0liSfJpsqpbKyLvEjynpyJz3EWrpexOnbBkvIlIYOJfOiJCk2DQQ== 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 In-Reply-To: <20200921145738.GN12990@dhcp22.suse.cz> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 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