From owner-svn-src-all@freebsd.org Sun Nov 19 16:48:57 2017 Return-Path: Delivered-To: svn-src-all@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 051A3DB93D9; Sun, 19 Nov 2017 16:48:57 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 87E957E824; Sun, 19 Nov 2017 16:48:56 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id 5so13396162wmk.1; Sun, 19 Nov 2017 08:48:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=1YkeN+p23nbdptuvHybnmTSqCTgV/W5/Dz1nbJARj/Q=; b=g6cYBsSWZ2mSP8mKOnZk5Mp38aHgd/hq92fPExqd+T0lfK2whEijQGpp+8IOjEabv/ d9BN9ctytMOj0GYvkm68Wea7Mp/EQhBQVqp7fzFcumEUfyz/GBurRNU10j5pF/fyRnDo 6mp28D6tfL7W066+Z2xlcL4HP/VmVaKKEUsXYbMN6+gdJrGjopmt+LmpdeAGdjVW0WxN zITih6iRE8HLjCEeUq2YKGywUHnBhG7pq30ZIl6gVfVUfqEdXzHbyNRDmHHDze5aYLZi 7l4Gk/DUnY38+dKjcA997Qa+P4LGg+Mzqr343JZ40Mg2Ak6JDE1Y49Uy3eIhv4J6TlPh o66A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=1YkeN+p23nbdptuvHybnmTSqCTgV/W5/Dz1nbJARj/Q=; b=TKXcqbRmS4S1D+NKLYUi9WSbg/BgiT24R0Vz8cdqM8e4yHQ4gxo+d8z6qCg3BEbb0B zzVZBQu2OFb/7HLyOifp/IrC7SU1ULE/7xCoSrvh0ssPb9u47nInxfCWwyQdnE1kLH2u QBZ3L6+kXg9KmFL2YwcHXxKOdnU2LV8Fg78jfL0pGzptoKgF9CR7dbs82FkWKKfDBks3 7LI4GQ5ixKjWvMqJ+awhKwIr/beBlvENL5DmIsFqvUx4/F1aAnEIjS1FqIWQv2VpboyT ddJ+D/LM80USK2ddTAn44t2flkXibhpBPFN3z/+Zze2yHR6ZMVTUNW2ZCTSpI585Qm0e w2LQ== X-Gm-Message-State: AJaThX4uJYnVtuQC6kiN9qcXxcpL5BLdG3pDwtL9eOHA2FqBcgl/rypO 4NIT5XgdMXJG4NAHv5CBriaL0g== X-Google-Smtp-Source: AGs4zMbGUjB1oRB+hUrmp8YZuWO5/yW0XUqFdH+xBdvV9c+aMHiSFTcnIjdJoSJOPu/ot/jUthB79Q== X-Received: by 10.28.126.14 with SMTP id z14mr7469017wmc.121.1511110134543; Sun, 19 Nov 2017 08:48:54 -0800 (PST) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id b47sm1217999wra.94.2017.11.19.08.48.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Nov 2017 08:48:53 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sun, 19 Nov 2017 16:48:51 +0000 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325965 - head/libexec/rtld-elf Message-ID: <20171119164851.GA89581@brick> Mail-Followup-To: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711181321.vAIDLM6S028725@repo.freebsd.org> <20171118141007.GI2272@kib.kiev.ua> <20171119121245.GA88868@brick> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 16:48:57 -0000 On 1119T1040, Pedro Giffuni wrote: > > > On 11/19/17 07:12, Edward Tomasz Napierala wrote: > > On 1118T1610, Konstantin Belousov wrote: > >> On Sat, Nov 18, 2017 at 01:21:22PM +0000, Edward Tomasz Napierala wrote: > >>> Author: trasz > >>> Date: Sat Nov 18 13:21:22 2017 > >>> New Revision: 325965 > >>> URL: https://svnweb.freebsd.org/changeset/base/325965 > >>> > >>> Log: > >>> Increase rtld initial memory pool size from 32kB to 128kB. > >>> > >>> The old value was probably fine back in 1998, when that code was imported > >>> (although the comments still mention VAX, which was quite obsolete by then); > >>> now, however, it's too small to handle our libc, which results in some > >>> additional calls to munmap/mmap later on. Asking for more virtual address > >>> space is virtually free, and syscalls are not, thus the change. > >>> > >>> It was suggested by kib@ that this might be a symptom of a deeper problem. > >>> It doesn't only affect libc, though - the change also improves rtld memory > >>> management for eg KDE libraries. I guess it's just a natural bloat. > >> This is not what I said. > >> > >> My guess was that the large allocation you see in the ktrace output as > >> coming from rtld was really an allocation of the TLS segment, and it was > >> so large because libc has that large TLS segment. You did not checked this > >> guess against the actual code. > > Right, I stand corrected. > > > >> If my guess is true, I do not see a point in the change you made: the > >> memory consumption is externally imposed on rtld, and we should not try > >> to tailor it to single, whenever important, consumer. > > Here's where I disagree. The rtld is not some abstract concept, it's one > > of the components of the operating system, and it can and should be tweaked > > to match real life situations. Especially when it affects virtually all > > of its use cases, as is the case with libc. > > > > > > Being pragmatic ... > > Determining such values is almost always a trial-and-error process. > Perhaps 64k is makes everyone (especially KDE) happy? It was determined by trial and error. 128k is the smallest one that removes the need for addidional call to mmap on startup - not for KDE, but for every binary linked with libc, including true(1). Running kdeinit4 still results in a few such calls - although fewer than before (the value also affects the size of subsequent rtld allocations).