From owner-freebsd-current@FreeBSD.ORG Thu Jan 21 22:49:24 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 924CD106566C for ; Thu, 21 Jan 2010 22:49:24 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by mx1.freebsd.org (Postfix) with ESMTP id 56B308FC0C for ; Thu, 21 Jan 2010 22:49:24 +0000 (UTC) Received: by iwn1 with SMTP id 1so482986iwn.28 for ; Thu, 21 Jan 2010 14:49:23 -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=sVf+8pufJzAusc4LqBcXfJ5w4AK4rskMoIiKWE0rm9M=; b=U/lJ0PzEQvSXaR/hmtwYSQ3uIqULyEA6zSBB9bO0mpNDLSjWfUUOQWAAULjKLuOBxF 7CHdxWczQvvY4CBvCfOPzdowDJWh/PB9MX+dKSZVw0hVGdxlBUSBsOrrOIWZUNMl4QQf 0TULOdgw+f9Zqqr77HxpD964hocbL5k6mIoHw= 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=Pp30S578CFP9qU3aMNEoWtRkDX/ctMr4PyLdzhF78oeAmJhKUuF1tjsu0PzV4QglDV 7K10UJTv4x5EgJEM2nNEbHV1tZpBnUhygDPcHSJhQSSzDE/Rmwup5dX4odoV79MLNfuU 1id0FJuWJiULqqEZLPmjwP1bb0TK6MbuQ/Aps= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.150.2 with SMTP id w2mr2429021ibv.83.1264114163225; Thu, 21 Jan 2010 14:49:23 -0800 (PST) In-Reply-To: <4e6cba831001192332j1e23bb1chdf2f47664d3cb14a@mail.gmail.com> References: <20100117.142200.321689433999177718.okuno.kohji@jp.panasonic.com> <20100117.152835.119882392487126976.okuno.kohji@jp.panasonic.com> <3bbf2fe11001171858o4568fe38l9b2db54ec9856b50@mail.gmail.com> <4e6cba831001192332j1e23bb1chdf2f47664d3cb14a@mail.gmail.com> Date: Thu, 21 Jan 2010 23:49:23 +0100 X-Google-Sender-Auth: ac054d512b66b2a6 Message-ID: <3bbf2fe11001211449je30b643y53fe0830bcbf3e5d@mail.gmail.com> From: Attilio Rao To: Giovanni Trematerra Content-Type: text/plain; charset=UTF-8 Cc: Jeff Roberson , freebsd-current@freebsd.org, Kohji Okuno 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: Thu, 21 Jan 2010 22:49:24 -0000 2010/1/20 Giovanni Trematerra : > On Mon, Jan 18, 2010 at 3:58 AM, Attilio Rao wrote: >> 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 > > I stressed an 8-core machine with pho's stress2 kernel stress suite and > your patch seems to break the invariant THREAD_LOCKPTR_ASSERT in > turnstile_claim:subr_turnstile.c Oh, right, I guess what we really want is to block the td_lock. This is the new patch: http://www.freebsd.org/~attilio/sched_4bsd_schedlock2.diff Thanks a lot for your testing, it is much appreciated. Attilio -- Peace can only be achieved by understanding - A. Einstein