From owner-cvs-all Tue Apr 3 17:21: 8 2001 Delivered-To: cvs-all@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id B474837B71B; Tue, 3 Apr 2001 17:20:59 -0700 (PDT) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.2/8.9.3) id f340Kgi74269; Tue, 3 Apr 2001 17:20:42 -0700 (PDT) (envelope-from dillon) Date: Tue, 3 Apr 2001 17:20:42 -0700 (PDT) From: Matt Dillon Message-Id: <200104040020.f340Kgi74269@earth.backplane.com> To: Bosko Milekic Cc: Garrett Rooney , Alfred Perlstein , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys mbuf.h src/sys/kern uipc_mbuf.c References: <200104030315.f333FCX69312@freefall.freebsd.org> <20010403140457.B2952@electricjellyfish.net> <200104031813.f33ID4b58965@earth.backplane.com> <20010403194004.A15434@technokratis.com> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : The reason for the removal isn't related to pollution of system :structures per se (i.e. bloat). There were really only three locks, one :for each free list. : The removal is, the way I see it, a slight pessimization in some :cases at this moment, due to the increase of contention again, in some cases. :... Ok... hmm. Since compare-exchange support is mandatory now, why not simply use it to implement per-cpu free lists for mbufs that does not require any (mutex) locking at all? This solves the contention problem and the interrupt problem. e.g. (pseudo code) allocMBufHeader() { struct mbuf *mb; while ((mb = PerCpuMBufHeaderBase) != NULL) { if (cmpexchangeptr(&PerCpuMBufHeaderBase, mb, mb->mb_Next) == mb) break; } if (mb == NULL) { slow version } return(mb); } freeMBufHeader(mb) { for (;;) { mb->mb_Next = PerCpuMBufHeaderBase; if (cmpexchangeptr(&PerCpuMBufHeaderBase, mb->mb_Next, mb) == mb->mb_Next) break; } } -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message