From owner-freebsd-arm@freebsd.org Mon Apr 10 02:01:53 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50B2CD32010; Mon, 10 Apr 2017 02:01:53 +0000 (UTC) (envelope-from alan.l.cox@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 157446E7; Mon, 10 Apr 2017 02:01:53 +0000 (UTC) (envelope-from alan.l.cox@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id l7so79076932ioe.3; Sun, 09 Apr 2017 19:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=z6n7AHYe/CeqWlfBZJM8VcXFSXQNpkIfC+ppK2DMQPo=; b=nXg6GCeXhiclxm7DtE3Y6Vbp6HgKF2WMa6ylfbPHzpi3uz+7fsP0VGz7iZwW/+2M4c B6OlsIym84KwZbSOtXVKYdcWfF+zquLbTzrStecnhDeVh4UG0Y2tUt3YFsMu7aGF61fH ygCS/E1EUxLgWsQFXmRBfYhCR5x8AOjvTGBTWFSDcaJEYNmG1gqTOT12gx/C6bMTrXKF ZUMtrLRMMEPxZ+ZGcrWRibX8LfsaFGP+uGReTHzRhTJJifRgG+HR8jB/oSTLChOqsdfW OwsVLx2Gy0e5DeES1N+43LzSIHTsO5lBZviBAAXxCLOQKo38EPc5Ej1JayOfHOavRSNk yO5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=z6n7AHYe/CeqWlfBZJM8VcXFSXQNpkIfC+ppK2DMQPo=; b=GMt/FUcJb3P0Vv7RGSMLLXK47LZkHqgculVM3w1h6XuhsIUZIElE+iFHv0yY6P3UiS yA8/sxc+iOcSoCYP1TTqqMz79UIBvVpeINhjQWmuERDdQTFhiGLPOiljWT2WWTptubOp r3qaXxK/Hi6lf9z/Twv84CFt/ZfRMYYszi1rKiFbPBA5niG2+ASvA85lFynrOUzn8GjY tOn6c2Mn7GQ51uv0tbsLek9FCY6n3OUekQkS0NbEaE6b3q5t3OMiegSg+zDaPU4U7dZB uQMIQf7bHuh1sWWLZ7NmPRnjtL99MS2jY0cP8ebOo421Uh69uW9vuBfX/7ioKz+zqAqx vdig== X-Gm-Message-State: AN3rC/5Xiet9lwe3Yexe2t4qbzEqeKjWGf4w4ZjDplCRVYnZ0TfWk40K /62Qx34QWrLvvbQEfBp1PuAgZHeQrg== X-Received: by 10.36.36.131 with SMTP id f125mr10145622ita.45.1491789712474; Sun, 09 Apr 2017 19:01:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.15.130 with HTTP; Sun, 9 Apr 2017 19:01:51 -0700 (PDT) Reply-To: alc@freebsd.org In-Reply-To: <89D6D677-3BE2-45E2-A902-CC6A0305F3F9@dsl-only.net> References: <4DEA2D76-9F27-426D-A8D2-F07B16575FB9@dsl-only.net> <163B37B0-55D6-498E-8F52-9A95C036CDFA@dsl-only.net> <08E7A5B0-8707-4479-9D7A-272C427FF643@dsl-only.net> <20170409122715.GF1788@kib.kiev.ua> <9D152170-5F19-47A2-A06A-66F83CA88A09@dsl-only.net> <9DCAF95B-39A5-4346-88FC-6AFDEE8CF9BB@dsl-only.net> <8FFE95AA-DB40-4D1E-A103-4BA9FCC6EDEE@dsl-only.net> <89D6D677-3BE2-45E2-A902-CC6A0305F3F9@dsl-only.net> From: Alan Cox Date: Sun, 9 Apr 2017 21:01:51 -0500 Message-ID: Subject: Re: The arm64 fork-then-swap-out-then-swap-in failures: a program source for exploring them To: Mark Millard Cc: Konstantin Belousov , andrew@freebsd.org, freebsd-hackers , freebsd-arm Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 02:01:53 -0000 On Sun, Apr 9, 2017 at 7:10 PM, Mark Millard wrote: > On 2017-Apr-9, at 10:24 AM, Mark Millard wrote: > > > On 2017-Apr-9, at 5:27 AM, Konstantin Belousov > wrote: > > > > >> Hmm, could you try the following patch, I did not even compiled it. > > > > I'll try it later today. > > > >> diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c > >> index 3d5756ba891..55aa402eb1c 100644 > >> --- a/sys/arm64/arm64/pmap.c > >> +++ b/sys/arm64/arm64/pmap.c > >> @@ -2481,6 +2481,11 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, > vm_offset_t eva, vm_prot_t prot) > >> sva += L3_SIZE) { > >> l3 = pmap_load(l3p); > >> if (pmap_l3_valid(l3)) { > >> + if ((l3 & ATTR_SW_MANAGED) && > >> + pmap_page_dirty(l3)) { > >> + vm_page_dirty(PHYS_TO_VM_PAGE(l3 & > >> + ~ATTR_MASK)); > >> + } > >> pmap_set(l3p, ATTR_AP(ATTR_AP_RO)); > >> PTE_SYNC(l3p); > >> /* XXX: Use pmap_invalidate_range */ > > > Preliminary testing indicates that this fixes the > some-pages-become-zero problem for fork-then-swapout/in. > > Thanks! > > I'll see if a buildworld can go through without being stopped > by the type of issue. But that will take a while. (It is how > I originally ran into the problem(s) that others had been > reporting on the lists.) > > > Side notes: > > The decreasing-RES(ident memory) behavior was unchanged. > > The "child gets only 80K RES initially" behavior was also > unchanged. > > That is because the arm64 pmap doesn't implement pmap_copy(). > (These are as shown by "top -PCwaopid" . These are just > differences with what I see for other TARGET_ARCH's.) > > === > Mark Millard > markmi at dsl-only.net > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >