From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 2 15:08:39 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67359106566B; Sun, 2 Oct 2011 15:08:39 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 07EB58FC0C; Sun, 2 Oct 2011 15:08:38 +0000 (UTC) Received: by vcbf13 with SMTP id f13so3206197vcb.13 for ; Sun, 02 Oct 2011 08:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=uq2e0y8rkKK+Lf0Op19AaNwzR/e6qA6AsOBtUjn61yQ=; b=MVi9sf/NQ2ZLS7Gm5QVGpgqxgaT7d4UuXiKpAL9f4Nf2dj9+1fYkEm0jPxIpYTG5nD mwFkZWSK7Dbj93P4nPOpeGu0aV4T0GSaCuqlsqKrcJYAdMmH6TUt4FM74WvYqkn7uFO5 f4ytBDh3ztGIwWq3qlXYzqRbTJBl9Nm0kJxyI= MIME-Version: 1.0 Received: by 10.52.36.212 with SMTP id s20mr9833456vdj.31.1317568117571; Sun, 02 Oct 2011 08:08:37 -0700 (PDT) Received: by 10.52.179.228 with HTTP; Sun, 2 Oct 2011 08:08:37 -0700 (PDT) In-Reply-To: <16010671866.20111002183758@serebryakov.spb.ru> References: <358651269.20111002162109@serebryakov.spb.ru> <1393358703.20111002174545@serebryakov.spb.ru> <16010671866.20111002183758@serebryakov.spb.ru> Date: Sun, 2 Oct 2011 17:08:37 +0200 Message-ID: From: Davide Italiano To: lev@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2011 15:08:39 -0000 On Sun, Oct 2, 2011 at 4:37 PM, Lev Serebryakov wrote: > Hello, Davide. > You wrote 2 =D0=BE=D0=BA=D1=82=D1=8F=D0=B1=D1=80=D1=8F 2011 =D0=B3., 18:0= 0:26: > >>> =C2=A0BTW, I/O is often require big buffers, up to MAXPHYS (128KiB for >>> =C2=A0now), do you mean, that any allocation of such memory has >>> =C2=A0considerable performance penalties, especially on multi-core and >>> =C2=A0multi-CPU systems? >>> >> In fact, the main client of such kind of allocations is the ZFS >> filesystem (this is due to its mechanism of adaptative cache >> replacement, ARC). Afaik, at the time in which UMA was written, such >> kind of allocations you describe were so infrequent that no initial >> effort was made in order to optimize them. >> People tried to address this issue by having ZFS create a large number >> of UMA zones for large allocations of different sizes. Unfortunately, >> one of the side-effects of this approach was the growth of the >> fragmentation, so we're investigating about. > =C2=A0 What about these geom modules, which allocate buffers, because nee= d > =C2=A0to read more, than requested by upper layer? geom_cache and > =C2=A0geom_raid3, for example? I wasn't aware about that, thanks a lot for pointing me out. I'll surely look at them. > =C2=A0 And "my" geom_raid5 -- I begin to understand, why original author > =C2=A0of geom_raid5 (which need MAXPHYS-sized buffers regularry) wrote it= s > =C2=A0own memory management layer... > If you're interested in what we're doing, contact me or poke me on efnet.or= g. > -- > // Black Lion AKA Lev Serebryakov > >