From owner-freebsd-hackers@freebsd.org Thu May 25 14:55:40 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 6AE49D819CB for ; Thu, 25 May 2017 14:55:40 +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 008A11C0B for ; Thu, 25 May 2017 14:55:39 +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 v4PEtW3D027835 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 May 2017 17:55:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4PEtW3D027835 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4PEtWKu027810; Thu, 25 May 2017 17:55:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 25 May 2017 17:55:32 +0300 From: Konstantin Belousov To: Shrikanth Kamath Cc: freebsd-hackers@freebsd.org Subject: Re: Difference between p_vmspace quota between stable/11 and stable/10 Message-ID: <20170525145532.GU1622@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) 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: Thu, 25 May 2017 14:55:40 -0000 On Thu, May 25, 2017 at 01:13:39AM -0700, Shrikanth Kamath wrote: > Thanks for the reply Konstantin, I captured the procstat -v snapshots > for the forked process (got the readings for both stable/10 vs > stable/11). I am still trying to figure how to interpret these > mappings, > > In stable/11 the first few lines of procstat -v show > > PID START END PRT RES PRES REF SHD FLAG TP PATH > > 19933 0x8048000 0x877e000 r-x 933 1003 2 1 CN-- > vn /packages/mnt/junos-platform/sbin/dcd > 19933 0x877e000 0x87f2000 rw- 70 0 1 0 C--- > vn /packages/mnt/junos-platform/sbin/dcd > 19933 0x87f2000 0x8a73000 rw- 59 59 1 0 C--- df > 19933 0xc8797000 0xc87a1000 rw- 10 10 1 0 CN-- df > > The same for stable/10 show > > PID START END PRT RES PRES REF SHD FL TP PATH > > 43678 0x8048000 0x8779000 r-x 943 1014 2 1 CN-- > vn /packages/mnt/junos-platform/sbin/dcd > 43678 0x8779000 0x87ed000 rw- 70 0 1 0 C--- > vn /packages/mnt/junos-platform/sbin/dcd > 43678 0x87ed000 0x2cc00000 rw- 145872 145872 1 0 C-S- df > 43678 0xc8792000 0xc879c000 rw- 10 10 1 0 C--- df > > > The third entry in two cases show a stark difference, does this > indicated the space that was setup was much lower compared to > stable/10? > I am not sure what you mean by 'the space that was setup was much lower'. Right after the mapping for the program' initialized data segment, follows a BSS segment which grows into the sbrk segment. The mapping in stable/10 map which starts at address 0x87ed000 looks like grown sbrk segment due to this. System does not mmap() something there, unless mmap is explicitely asked to, by the 'address' argument, and perhaps MAP_FIXED flag. Note that even in stable/10, jemalloc(3) uses mmap and not sbrk, so I have no idea what that mapping is. Either you reconfigured jemalloc() to use sbrk, or called sbrk in the program explicitely, or called mmap() with the address hint in sbrk area. You should ktrace your program to see what caused creation of the mapping.