From owner-freebsd-hackers@freebsd.org Tue Mar 28 07:56:55 2017 Return-Path: Delivered-To: freebsd-hackers@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 9684DD209E6 for ; Tue, 28 Mar 2017 07:56:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EFC6D27; Tue, 28 Mar 2017 07:56:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v2S7um2h019487 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 28 Mar 2017 10:56:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v2S7um2h019487 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v2S7ul0q019486; Tue, 28 Mar 2017 10:56:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 28 Mar 2017 10:56:47 +0300 From: Konstantin Belousov To: Mark Millard Cc: Steven Hartland , "freebsd-hackers@freebsd.org" , "K. Macy" Subject: Re: Help needed to identify golang fork / memory corruption issue on FreeBSD Message-ID: <20170328075647.GP43712@kib.kiev.ua> References: <18b40a69-4460-faf2-c0ce-7491eca92782@multiplay.co.uk> <20170317082333.GP16105@kib.kiev.ua> <180a601b-5481-bb41-f7fc-67976aabe451@multiplay.co.uk> <20170317124437.GR16105@kib.kiev.ua> <5ba92447-945e-6fea-ad4f-f58ac2a0012e@multiplay.co.uk> <20170327161833.GL43712@kib.kiev.ua> <3ec35a46-ae70-35cd-29f8-82e7cebb0eb6@multiplay.co.uk> <20170327164905.GN43712@kib.kiev.ua> <065E68C9-C9D5-4702-98A0-42E1A4FA8187@dsl-only.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <065E68C9-C9D5-4702-98A0-42E1A4FA8187@dsl-only.net> User-Agent: Mutt/1.8.0 (2017-02-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 07:56:55 -0000 On Mon, Mar 27, 2017 at 01:43:38PM -0700, Mark Millard wrote: > On 2017-Mar-27, at 9:49 AM, Konstantin Belousov wrote: > > > On Mon, Mar 27, 2017 at 05:33:49PM +0100, Steven Hartland wrote: > >> On 27/03/2017 17:18, Konstantin Belousov wrote: > . . . > >> I noticed in vm_map_copy_entry the following: > >> /* > >> * We don't want to make writeable wired pages > >> copy-on-write. > >> * Immediately copy these pages into the new map by > >> simulating > >> * page faults. The new pages are pageable. > >> */ > >> vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry, > >> fork_charge); > >> > >> I wondered if I could use vm_fault_copy_entry to force the copy on fork? > > No, the vm_fault_copy_entry() only works with wired entries, e.g. it cannot > > page in not yet touched page, and the result is also wired. > . . . > > I'm confused by the comment vs. the above note: > > Comment: The new pages are pageable. > This note: the result is also wired Yes, my note about destination state is not true. Still, the code cannot page in source pages, and the intent of the note above was that shadow chain for the destination entry will be invalid even if required page-ins were done. > > So pagable wired pages? Incorrect comment? Comment > that needs more context specified so the interpretation > is clearer? > > > === > Mark Millard > markmi at dsl-only.net >