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=-2.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 EE9DAC4346E for ; Sun, 27 Sep 2020 04:09:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4680C23899 for ; Sun, 27 Sep 2020 04:09:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="c7UE0NHT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4680C23899 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 4C45F6B005C; Sun, 27 Sep 2020 00:09:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4744D6B005D; Sun, 27 Sep 2020 00:09:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 361936B0068; Sun, 27 Sep 2020 00:09:34 -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 1ECEF6B005C for ; Sun, 27 Sep 2020 00:09:34 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C6AF9181AE869 for ; Sun, 27 Sep 2020 04:09:33 +0000 (UTC) X-FDA: 77307512226.22.jail03_1100b2e27175 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id A352D18038E60 for ; Sun, 27 Sep 2020 04:09:33 +0000 (UTC) X-HE-Tag: jail03_1100b2e27175 X-Filterd-Recvd-Size: 6323 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Sun, 27 Sep 2020 04:09:32 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601179772; 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=f0ZsaGLswLr8ipOrjSQOQ2SQHjzZPHlfoNjcnvrdWss=; b=c7UE0NHTHY15uZdNlHqWzhyy2tdx2vTuOrzLTTfrEV0K/QhjjM7L+44H8+v88aCIgFIWgL M45ft4QjLD1BKz19Cvh4GP7s9mkHREMOkgG50BfblX1BQotAbMpkcr0Yk0BiMCUYksou7E TXbqakY0H5/E/Lcl9TCtTN+Nx8w6HVQ= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-b4-ywk9WOlmwz6emoY5nWg-1; Sun, 27 Sep 2020 00:09:29 -0400 X-MC-Unique: b4-ywk9WOlmwz6emoY5nWg-1 Received: by mail-lj1-f200.google.com with SMTP id x24so1913930ljh.4 for ; Sat, 26 Sep 2020 21:09:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f0ZsaGLswLr8ipOrjSQOQ2SQHjzZPHlfoNjcnvrdWss=; b=rdqJIUpkQg+h+3T4eIrTHuYLzElCHChY8cOoO724pHCLEY5Brb23aN15w3vGWr20mB xQjWngr5tOmtWEOL9JEZe3ukbZNcX6vYkh/fbOkenIxd2CRSJGTIAXUu67OOa1WCzHrS oMSzTBEbN6IYIwanEK7oRv1APEMES0CSdWU+i4VQJdxihgJr28VD0oowbB2fOHk7mPvW YTZvVYLEEnT8l2laDUX2n6fSYBjA4oBCaGxpV25qxKdw5AllHb7l6Y5dNlETuBdPhaQ5 aBjlrUA0lwgDFEfMu/Yif0XA6CS7sYkFGnIgjgVFBluUe2rjIOdJiA5s6hYdKHPzd9jF 9LCg== X-Gm-Message-State: AOAM531XhNmNK7zzN+3iE3sICvD4casFw0So7ohFOZGa/IrwX/EygxoP i4M8ltUUn2nuU5gapyhcoE9s4fcMRRjCti4xIYAAEXFZfw13j+LNZtc7jgj2RtpRrhchL0lu540 mfCkb3IPndhrynKA13oo6Jk4QQ0A= X-Received: by 2002:ac2:51a3:: with SMTP id f3mr1772003lfk.361.1601179767503; Sat, 26 Sep 2020 21:09:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5v6i6hUJlAQl1XURqVD/ITNVoPhmBbl2DFh5Ob9JLuXHbkUY7z7wVxOLMYocKPzmR3RUypkbLFZjTRtfi97I= X-Received: by 2002:ac2:51a3:: with SMTP id f3mr1771981lfk.361.1601179767281; Sat, 26 Sep 2020 21:09:27 -0700 (PDT) MIME-Version: 1.0 References: <20200925222600.6832-1-peterx@redhat.com> <20200925222600.6832-4-peterx@redhat.com> <20200926232335.GA348793@ziepe.ca> In-Reply-To: From: Peter Xu Date: Sun, 27 Sep 2020 00:09:19 -0400 Message-ID: Subject: Re: [PATCH v2 3/4] mm: Do early cow for pinned pages during fork() for ptes To: Linus Torvalds Cc: Jason Gunthorpe , Linux Kernel Mailing List , Linux-MM , John Hubbard , Andrew Morton , Christoph Hellwig , Yang Shi , Oleg Nesterov , Kirill Tkhai , Kirill Shutemov , Hugh Dickins , Jann Horn , Michal Hocko , Jan Kara , Andrea Arcangeli , Leon Romanovsky Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=zhexu@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000004033d805b043b7f8" 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: --0000000000004033d805b043b7f8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Linus Torvalds =E4=BA=8E 2020=E5=B9=B49=E6= =9C=8826=E6=97=A5=E5=91=A8=E5=85=AD 20:05=E5=86=99=E9=81=93=EF=BC=9A > > > + page_add_new_anon_rmap(new_page, new, > addr, false); > > > + rss[mm_counter(new_page)]++; > > > + set_pte_at(dst_mm, addr, dst_pte, pte); > > > > Linus's patch had a lru_cache_add_inactive_or_unevictable() here, like > > wp_page_copy() > > Yeah, I do think that is needed so that we have the new page on the > LRU and it gets properly evicted under memory pressure. > Oops, yes we definitely need this one. Thanks, > --0000000000004033d805b043b7f8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Linus Torvalds <torvalds@linux-foundation.org> =E4=BA=8E 2020=E5=B9=B49=E6=9C= =8826=E6=97=A5=E5=91=A8=E5=85=AD 20:05=E5=86=99=E9=81=93=EF=BC=9A
=
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pa= ge_add_new_anon_rmap(new_page, new, addr, false);
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rss[mm_counter(new_page)]++;
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set_pte_at(dst_mm, addr, dst_pte, = pte);
>
> Linus's patch had a lru_cache_add_inactive_or_unevictable() here, = like
> wp_page_copy()

Yeah, I do think that is needed so that we have the new page on the
LRU and it gets properly evicted under memory pressure.

Oops, yes we definit= ely need this one.

Thank= s,
--0000000000004033d805b043b7f8--