From owner-svn-src-all@freebsd.org Sun Nov 19 12:12:50 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 A78E4DF3C3B; Sun, 19 Nov 2017 12:12:50 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (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 45AC57640A; Sun, 19 Nov 2017 12:12:50 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id g130so3222757wme.0; Sun, 19 Nov 2017 04:12:50 -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=VbLKUPYzHFI1C3ZS7+HulQfVoMs/e7oVk0aZ0h+ggf0=; b=NL710Dhrid2wuD3vJ5P+lKoU/ix/IG5G7E0CMIv0yN9Jlj8L8DV9t2cLLA5p0E7LAZ nD185HaG5SRCZ4SLYOcNpG2g2yju1EKsPuJF8VfirtSiUQJmBqR1kbjVXrcxuMSZwY0o QahVY5AdJDH9W+gPeD7SppwvtHxmxjXMYgbPaPF2aHTr5eqDKWEj0D1VxyRjztBYASzQ wviDYX5Vv99S+hu3/sohQlMB/HyorlvXitgI7IdWjJdKOEZdCQ9PEragoo49tnA210lk wgQwCHIK4x3ynD/1UorQhSg46I8UgwGr+qLWDzSPje6v6ZymzlYGEFtNAMHbe/N2hZ3f MnFA== 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=VbLKUPYzHFI1C3ZS7+HulQfVoMs/e7oVk0aZ0h+ggf0=; b=EzTVWUSa5KakrzTRKpSCw4WtVyaGU3ZkEG0aRY40dq5hd36VFXT8MSF/PBbp42EDtH QjB9VBHv1cQPvHcwVmo96qC9qrQTKZh4wScpbEJioj48OtMmZmjJbHQng8b+f2qL5OnN wEqyC8G9hNWELdPN8GP5y93iUMSvW8khkoMXR2IqMONVdCMXeSjZ0teAetH9j5kS4yq9 9DlHT2IlP1/zf0Qgyjy+Od+a7FcCp0hSfd02lCjgHiH5vtDgCW0i2AvaHj3sWiJRgsw+ ogNcc5Wa2NREAqnCICcHaQgGlYEWHxK5Z5TAHGmBzp8ekYCFkswnrQDu2Tb1b282BF0J ESag== X-Gm-Message-State: AJaThX7FZDjX4AEqwhsfPoQmfLy81IZLG22NKVSzMYWsYjmMSGD1tI3M uEAKvU3HDTTxKmx1S6h+PO0B8Q== X-Google-Smtp-Source: AGs4zMbPoshvwdm7jVCZxoWnu5l4KlLcaialyIFSFixnQBWqoX9rKFGNLMPiXQ/5ENfPPLMBT3ygYQ== X-Received: by 10.28.48.143 with SMTP id w137mr8302349wmw.3.1511093568775; Sun, 19 Nov 2017 04:12:48 -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 y2sm3657744wrd.3.2017.11.19.04.12.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Nov 2017 04:12:47 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sun, 19 Nov 2017 12:12:45 +0000 From: Edward Tomasz Napierala To: Konstantin Belousov 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: <20171119121245.GA88868@brick> Mail-Followup-To: Konstantin Belousov , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171118141007.GI2272@kib.kiev.ua> 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 12:12:50 -0000 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.