From owner-freebsd-arch@FreeBSD.ORG Tue May 29 19:04:49 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A81616A468 for ; Tue, 29 May 2007 19:04:49 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.179]) by mx1.freebsd.org (Postfix) with ESMTP id 0F62613C469 for ; Tue, 29 May 2007 19:04:48 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: by ik-out-1112.google.com with SMTP id c21so848512ika for ; Tue, 29 May 2007 12:04:47 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qADNHAqynDBrhEJquUCEfpfqps80Jg3RIfjz1BiffAX3zMxRs3gqneHz/8gYPiq6jvAsAHgQ7m/x0qStX7V270e+DN2y+/BR2dPzyjuv9He/qaOeoucm+bIGQ+SOdHP4OXOljkuyWgfbd4+Y4UXyvk01hI59fPU1+fAcOdgwu8s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LsPQrmMNMBZCZxmrbN7XIhwjQf9rpLIuPUPSH6hwuIW1wklX9Utmook9wYNtCCq5NCuMqJ9nUgadXntP5Cs9STAUA3kR48RUpusaboydoFEyUIIv5sAZp8U2oBRRqo9deJVqY8+p929xhYUeOM2gG4NwX5nzX+o1VqaywpCbJis= Received: by 10.78.138.6 with SMTP id l6mr2081186hud.1180465487505; Tue, 29 May 2007 12:04:47 -0700 (PDT) Received: by 10.78.107.13 with HTTP; Tue, 29 May 2007 12:04:47 -0700 (PDT) Message-ID: Date: Tue, 29 May 2007 12:04:47 -0700 From: "Kip Macy" To: "John Baldwin" In-Reply-To: <200705291456.38515.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070529105856.L661@10.0.0.1> <200705291456.38515.jhb@freebsd.org> Cc: freebsd-arch@freebsd.org Subject: Re: rusage breakdown and cpu limits. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2007 19:04:49 -0000 > I think using a per-process spin lock (or a pool of spin locks) would be a > good first step. I wouldn't do anything more complicated unless the simple > approach doesn't work. The only reason to not move the check into userret() > would be if one is worried about threads chewing up CPU time while they are > in the kernel w/o bouncing out to userland. Also, it matters which one > happens more often (userret() vs mi_switch()). If on average threads perform > multiple system calls during a single time slice (no idea if this is true or > not), then moving the check to userret() would actually hurt performance. Processes can certainly make numerous system calls within a single time slice. However, in userret it would be protected by a per process or per thread blocking mutex as opposed to a global spin mutex. It would be surprising if it isn't a net win, although it is quite possible that on a 2-way system the extra locking could have an adverse effect on some workloads. -Kip