From owner-freebsd-current@FreeBSD.ORG Thu Jan 21 23:26:55 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 53F7410656C7 for ; Thu, 21 Jan 2010 23:26:55 +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 178178FC16 for ; Thu, 21 Jan 2010 23:26:54 +0000 (UTC) Received: by iwn1 with SMTP id 1so509964iwn.28 for ; Thu, 21 Jan 2010 15:26:54 -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=h02snSL1dg7s2+xphlxgnQfyM77+TggbeRMsGOwAQ4I=; b=ZWXzJqOGH9gBlvda1hRnY7SeReAEPtZYMEyyJqk8Ce+Lad5OxFB6YQc6j8+d7I6Z8S 78jJft2erbs6nOSSn40n9m5JLfZLSL//YCl4OOk9OOJr8WpJT6kAosNAqPCW7NLtUxNW i4AWGVqisVp4upwLd8BaVr9j3EcZRxP4GWPpM= 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=ruDvbNaBvk2CFoMMOMVcCPdsAbj/X5q3B2FclFZcgOn2NpnDGFvqgm8UfNXZpouiGY NDMrPa9DtGq6Ri4jFx29451XU4I6jSRssMi4p2I7B7zBvsTN5oedKjJRtpsuUTSzQp1c QDDA6F14J8Mipi701KWukdwl0oNcQ8JyPgU2Y= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.147.210 with SMTP id m18mr3481272ibv.48.1264116414320; Thu, 21 Jan 2010 15:26:54 -0800 (PST) In-Reply-To: <3bbf2fe11001211449je30b643y53fe0830bcbf3e5d@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> <3bbf2fe11001211449je30b643y53fe0830bcbf3e5d@mail.gmail.com> Date: Fri, 22 Jan 2010 00:26:54 +0100 X-Google-Sender-Auth: 89616ff8f315f7bd Message-ID: <3bbf2fe11001211526r1ac89d13md5fbc1e0d6b9a160@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 23:26:55 -0000 2010/1/21 Attilio Rao : > 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 FYI, I've updated the patch with a more correct use of thread_lock_block() and a merge of this interface with the custom interface of thread_block_switch() from ULE. The overall result should be better (and more correct). Please refresh your patch. Testing with ULE should be due as well. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein