From owner-freebsd-current@FreeBSD.ORG Thu May 29 18:24:47 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D62564E; Thu, 29 May 2014 18:24:47 +0000 (UTC) Received: from mail-qg0-x233.google.com (mail-qg0-x233.google.com [IPv6:2607:f8b0:400d:c04::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF2512688; Thu, 29 May 2014 18:24:46 +0000 (UTC) Received: by mail-qg0-f51.google.com with SMTP id q107so2138896qgd.38 for ; Thu, 29 May 2014 11:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kw31uQsicM2vMgszXdxC33RXaUtA1WOqv+Lubol1u2k=; b=XH56tZ5NHms9kC0izaan22I6rHnTdXItHOIbPyb/jko/BU0jwl9HEpI8MUeTMCVH8x F7aWgBpo3ce4/Tc5kz3j4t0R/3ekxZF7jO7qBJS88kAJTe14NOATwPsE6yEeSDSxrrTB Q3A54t1JdNr1R+fdGKaZM58ZDOArmfJ7MuLszl8tn6w3/03n6GnSZM75Adz230BKBczK bV6rSu4U980U1m9gThkL1uSLLxNmY2C09Dnw71bNdgiyLOM1yjnoccMT7CiSJ3tDnb/w 8HbrSGojH+qnrNhXEfrF32jhJBOuTtjwBijf/rSZ5+VKdc95FA3f43u43rAVf8bL9jUQ nfCg== MIME-Version: 1.0 X-Received: by 10.140.22.209 with SMTP id 75mr12318973qgn.4.1401387885744; Thu, 29 May 2014 11:24:45 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Thu, 29 May 2014 11:24:45 -0700 (PDT) In-Reply-To: <201405291318.36130.jhb@freebsd.org> References: <20140524014713.GF13462@carrick-users.bishnet.net> <201405281358.35924.jhb@freebsd.org> <201405291318.36130.jhb@freebsd.org> Date: Thu, 29 May 2014 11:24:45 -0700 X-Google-Sender-Auth: pKkHPWn6HaPCfdlkRUp7akn2rtU Message-ID: Subject: Re: Processor cores not properly detected/activated? From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: Attilio Rao , freebsd-current , Jia-Shiun Li , Alan Somers , Tim Bishop X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 18:24:47 -0000 On 29 May 2014 10:18, John Baldwin wrote: >> > It costs wired memory to increase it for the kernel. The userland set size >> > can be increased rather arbitrarily, so we don't need to make it but so large >> > as it is easy to bump later (even with a branch). >> >> Well, what about making the API/KBI use cpuset_t pointers for things >> rather than including it as a bitmask? Do you think there'd be a >> noticable performance overhead for the bits where it's indirecting >> through a pointer to get to the bitmask data? > > The wired memory is not due to cpuset_t. The wired memory usage is due to things > that do 'struct foo foo_bits[MAXCPU]'. The KBI issues I mentioned above are > 'struct rmlock' (so now you want any rmlock users to malloc space, or you > want rmlock_init() call malloc? (that seems like a bad idea)). The other one > is smp_rendezvous. Plus, it's not just a pointer, you really need a (pointer, > size_t) tuple similar to what cpuset_getaffinity(), etc. use. Why would calling malloc be a problem? Except for the initial setup of things, anything dynamically allocating structs with embedded things like rmlocks are already dynamically allocating them via malloc or uma. There's a larger fundamental problem with malloc, fragmentation and getting the required larger allocations for things. But even a 4096 CPU box would require a 512 byte malloc. That shouldn't be that hard to do. It'd just be from some memory that isn't close to the rest of the lock state. -a