From owner-svn-src-head@FreeBSD.ORG Fri Sep 12 19:41:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81ED68A3; Fri, 12 Sep 2014 19:41:07 +0000 (UTC) Received: from mail-qa0-x235.google.com (mail-qa0-x235.google.com [IPv6:2607:f8b0:400d:c00::235]) (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 0EFBBE69; Fri, 12 Sep 2014 19:41:06 +0000 (UTC) Received: by mail-qa0-f53.google.com with SMTP id n8so1230642qaq.26 for ; Fri, 12 Sep 2014 12:41:04 -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=X5amOXBYz89on/CRKp9I1j6/cdJC0SUeP0Z/go4vW78=; b=eBGe6kKUIzfL23LCdNh2OliinUvTCG/pRQKUQu5KGN0pV3QC8qQ7Qp5kW1tgelGzdN uwR3872KDFZfrCP5Kdq7pqYMBVN5C4DCpHqZ3XBvEE5ETtpj30VAxwjlapw7o+Pol9oR agPFDxmr/ZyuvbfNnWMLiiMZOSJqGixr0cR1p9gCOq9eGHDYcHVaxzH4hY3LJcfzBKIQ eFoYLRRa/2FRwcoDmU0YVObN+GLnMX7eC+34PQ0HEtYlfCNiXzsSvVvHrYSfvbkZVie0 ci8jOpoy5aYR8Np4ivpegqcmW7aHM0DJBU6SRDpm2e5aLFbjJF5zwkrUn0RoNHPZZVik M4lA== MIME-Version: 1.0 X-Received: by 10.140.31.75 with SMTP id e69mr16026757qge.2.1410550864396; Fri, 12 Sep 2014 12:41:04 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Fri, 12 Sep 2014 12:41:04 -0700 (PDT) In-Reply-To: <201408140531.s7E5VeWw077792@svn.freebsd.org> References: <201408140531.s7E5VeWw077792@svn.freebsd.org> Date: Fri, 12 Sep 2014 12:41:04 -0700 X-Google-Sender-Auth: 1VQTNrfT15Um78Ze9HD5qTMivig Message-ID: Subject: Re: svn commit: r269964 - head/sys/kern From: Adrian Chadd To: Xin LI Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2014 19:41:07 -0000 Hi guys, Both r269963 and r269964 have broken the MIPS platforms with smaller amounts of RAM (< 64MB.) Sean noticed it and filed a bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193465 Can we please figure out what changed? Otherwise I'm going to revert these two changes until we figure out what happened. Thanks, -a On 13 August 2014 22:31, Xin LI wrote: > Author: delphij > Date: Thu Aug 14 05:31:39 2014 > New Revision: 269964 > URL: http://svnweb.freebsd.org/changeset/base/269964 > > Log: > Add a new loader tunable, vm.kmem_zmax which allows a system administrator > to limit the maximum allocation size that malloc(9) would consider using > the UMA cache allocator as backend. > > Suggested by: alfred > MFC after: 2 weeks > > Modified: > head/sys/kern/kern_malloc.c > > Modified: head/sys/kern/kern_malloc.c > ============================================================================== > --- head/sys/kern/kern_malloc.c Thu Aug 14 05:13:24 2014 (r269963) > +++ head/sys/kern/kern_malloc.c Thu Aug 14 05:31:39 2014 (r269964) > @@ -172,6 +172,10 @@ u_long vm_kmem_size; > SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, > "Size of kernel memory"); > > +static u_long kmem_zmax = KMEM_ZMAX; > +SYSCTL_ULONG(_vm, OID_AUTO, kmem_zmax, CTLFLAG_RDTUN, &kmem_zmax, 0, > + "Maximum allocation size that malloc(9) would use UMA as backend"); > + > static u_long vm_kmem_size_min; > SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RDTUN, &vm_kmem_size_min, 0, > "Minimum size of kernel memory"); > @@ -485,7 +489,7 @@ malloc(unsigned long size, struct malloc > size = redzone_size_ntor(size); > #endif > > - if (size <= KMEM_ZMAX) { > + if (size <= kmem_zmax) { > mtip = mtp->ks_handle; > if (size & KMEM_ZMASK) > size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; > @@ -776,6 +780,9 @@ mallocinit(void *dummy) > > uma_startup2(); > > + if (kmem_zmax < PAGE_SIZE || kmem_zmax > KMEM_ZMAX) > + kmem_zmax = KMEM_ZMAX; > + > mt_zone = uma_zcreate("mt_zone", sizeof(struct malloc_type_internal), > #ifdef INVARIANTS > mtrash_ctor, mtrash_dtor, mtrash_init, mtrash_fini, > @@ -800,7 +807,7 @@ mallocinit(void *dummy) > } > for (;i <= size; i+= KMEM_ZBASE) > kmemsize[i >> KMEM_ZSHIFT] = indx; > - > + > } > } > SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_SECOND, mallocinit, NULL); >