From owner-freebsd-current@FreeBSD.ORG Mon Jan 18 02:58:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FA5D1065670 for ; Mon, 18 Jan 2010 02:58:43 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id A76108FC13 for ; Mon, 18 Jan 2010 02:58:42 +0000 (UTC) Received: by fxm27 with SMTP id 27so1849122fxm.3 for ; Sun, 17 Jan 2010 18:58:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=Hys3Ea1hVWTUMRFcifGkYPEsgL0vnZ19kL6NWi/jyrE=; b=P2RADtv8Z0WHiUNGcuYx+w7zd+LcjkzR16saAMTgtxDL+uuatYbbOQp4Skd+D3JgpF sjXjHZsrQxFLSrku7TQUb3RSiSpcuFW8UJtVlpHuQEzftkTbt1XkJ9ch+TnZYpk+8CZP lQ0KEWG6Cd2Yg4gqRUtlUKk4No4re/KULCQG0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=LQaTZVHsF9vkCMjjCjQ7pFKDcsdYDk/t0l5y8ftwMbDYregUZHcjT4wmuc49+0PUV8 irHxknfAm7MdPydfWpS9+2SeBcY0gCjVw46bPpit3ZDmeP91wHNt6wIDTBXlHTJsfM2I KhS8Pjr/SptRIebo62DyMHaUoXtQIg1osjMd8= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.132.203 with SMTP id c11mr6836621fat.27.1263783521393; Sun, 17 Jan 2010 18:58:41 -0800 (PST) In-Reply-To: <20100117.152835.119882392487126976.okuno.kohji@jp.panasonic.com> References: <20100117.142200.321689433999177718.okuno.kohji@jp.panasonic.com> <20100117.152835.119882392487126976.okuno.kohji@jp.panasonic.com> Date: Mon, 18 Jan 2010 03:58:41 +0100 X-Google-Sender-Auth: d23c91cda06b0eb1 Message-ID: <3bbf2fe11001171858o4568fe38l9b2db54ec9856b50@mail.gmail.com> From: Attilio Rao To: Kohji Okuno Content-Type: text/plain; charset=UTF-8 Cc: freebsd-current@freebsd.org, Jeff Roberson Subject: Re: Bug about sched_4bsd? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 18 Jan 2010 02:58:43 -0000 2010/1/17 Kohji Okuno : > Hello, > > Could you check sched_4bsd.patch, please? I think, instead, that what needs to happen is to have sched_switch() to do a lock handover from sleepq/turnstile spinlock to schedlock. That way, if threads are willing to contest on td_lock they will be still inhibited. I'm not sure if this patch breaks any invariant, if you may test I would appreciate: http://www.freebsd.org/~attilio/sched_4bsd_schedlock.diff Reviews and comments are appreciated. BTW, nice catch. Attilio -- Peace can only be achieved by understanding - A. Einstein