From owner-freebsd-stable@FreeBSD.ORG Sat May 13 15:22:43 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 932A416A42F for ; Sat, 13 May 2006 15:22:43 +0000 (UTC) (envelope-from ivoras@fer.hr) Received: from lara.cc.fer.hr (lara.cc.fer.hr [161.53.72.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F11E43D6A for ; Sat, 13 May 2006 15:22:40 +0000 (GMT) (envelope-from ivoras@fer.hr) Received: from [127.0.0.1] (localhost.cc.fer.hr [127.0.0.1]) by lara.cc.fer.hr (8.13.6/8.13.4) with ESMTP id k4DFMJdl095244; Sat, 13 May 2006 17:22:20 +0200 (CEST) (envelope-from ivoras@fer.hr) Message-ID: <4465F9AB.8010107@fer.hr> Date: Sat, 13 May 2006 17:22:19 +0200 From: Ivan Voras User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050921) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sam Leffler References: <4464FA8D.5060309@fer.hr> <44652D88.1070408@FreeBSD.org> <4465CA8B.7000509@fer.hr> <4465EE4D.2090701@FreeBSD.org> <4465F0E4.8020205@errno.com> In-Reply-To: <4465F0E4.8020205@errno.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: stable@freebsd.org Subject: Re: pagezero again X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 May 2006 15:22:47 -0000 Sam Leffler wrote: > Maybe this is the same problem jhb recently fixed in head with threads > getting assigned the wrong priority under certain conditions (it showed > up most easily with taskq threads). Is it this one: jhb 2006-04-17 18:20:38 UTC FreeBSD src repository Modified files: sys/dev/hwpmc hwpmc_mod.c sys/dev/random randomdev_soft.c sys/kern kern_intr.c kern_poll.c kern_synch.c kern_thr.c kern_umtx.c sched_4bsd.c subr_taskqueue.c uipc_mqueue.c sys/vm vm_zeroidle.c Log: Change msleep() and tsleep() to not alter the calling thread's priority if the specified priority is zero. This avoids a race where the calling thread could read a snapshot of it's current priority, then a different thread could change the first thread's priority, then the original thread would call sched_prio() inside msleep() undoing the change made by the second thread. I used a priority of zero as no thread that calls msleep() or tsleep() should be specifying a priority of zero anyway. The various places that passed 'curthread->td_priority' or some variant as the priority now pass 0. Revision Changes Path 1.24 +1 -8 src/sys/dev/hwpmc/hwpmc_mod.c 1.13 +2 -4 src/sys/dev/random/randomdev_soft.c 1.132 +3 -5 src/sys/kern/kern_intr.c 1.26 +1 -3 src/sys/kern/kern_poll.c 1.279 +5 -3 src/sys/kern/kern_synch.c 1.43 +2 -2 src/sys/kern/kern_thr.c 1.36 +4 -6 src/sys/kern/kern_umtx.c 1.78 +1 -1 src/sys/kern/sched_4bsd.c 1.36 +1 -1 src/sys/kern/subr_taskqueue.c 1.15 +2 -2 src/sys/kern/uipc_mqueue.c 1.37 +1 -3 src/sys/vm/vm_zeroidle.c Would it be enough just to apply this change to my 6.1-R tree: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/vm/vm_zeroidle.c.diff?r1=1.36&r2=1.37 ? It's probably not, so: any chance of MFC-ing the commit? :)