From owner-freebsd-arch@FreeBSD.ORG Wed Jun 27 14:29:38 2007 Return-Path: X-Original-To: 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 AF01B16A46C for ; Wed, 27 Jun 2007 14:29:38 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0A713C46C for ; Wed, 27 Jun 2007 14:29:37 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id B1ED28BECF8 for ; Wed, 27 Jun 2007 16:29:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CobR-PKbcwQN for ; Wed, 27 Jun 2007 16:29:35 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id A7B638BEAB9 for ; Wed, 27 Jun 2007 16:29:35 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id l5RETZcW067631 for arch@freebsd.org; Wed, 27 Jun 2007 16:29:35 +0200 (CEST) (envelope-from rdivacky) Date: Wed, 27 Jun 2007 16:29:35 +0200 From: Roman Divacky To: arch@freebsd.org Message-ID: <20070627142935.GA65176@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: semi-final version of *at syscalls patch 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: Wed, 27 Jun 2007 14:29:38 -0000 hi, as previously discussed on this list I implemented native FreeBSD *at syscalls. I tried to stick to POSIX draft as I downloaded it on June 21th. (can be found for free download on posix web site) This implements every file related syscall in the "Extended API" (I didnt touch socket things) completely except: 1) still missing O_EXECL (I need a little help with this as my previous attempt failed) 2) fdopendir (will be implemented in libc only) 3) fexecve() has title set to "fexecve neco" which is not ideal 4) libc bindings the conformance to the POSIX draft was tested with my (not cleaned-up but usable) testing program: www.vlakno.cz/~rdivacky/doat.c the patch itself can be found at: www.vlakno.cz/~rdivacky/linux_at-070627.patch I'd like to get some review for the patch, especially when it comes to locking and standard conformance (I did my best but I am still a human being so mistakes are possible). I'd also welcome some help with the libc part as I have never touched that before. some other comments and suggestions are welcomed as well of course thank you Roman Divacky From owner-freebsd-arch@FreeBSD.ORG Wed Jun 27 14:51:07 2007 Return-Path: X-Original-To: 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 453A016A421 for ; Wed, 27 Jun 2007 14:51:07 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id F3BEE13C458 for ; Wed, 27 Jun 2007 14:51:06 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id B65158BED15 for ; Wed, 27 Jun 2007 16:51:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BJl6m5GZuaio for ; Wed, 27 Jun 2007 16:51:04 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 64B9F8BEAB9 for ; Wed, 27 Jun 2007 16:51:04 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id l5REp4Cl068938 for arch@freebsd.org; Wed, 27 Jun 2007 16:51:04 +0200 (CEST) (envelope-from rdivacky) Date: Wed, 27 Jun 2007 16:51:04 +0200 From: Roman Divacky To: arch@freebsd.org Message-ID: <20070627145104.GA68910@freebsd.org> References: <20070627142935.GA65176@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070627142935.GA65176@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: semi-final version of *at syscalls patch 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: Wed, 27 Jun 2007 14:51:07 -0000 On Wed, Jun 27, 2007 at 04:29:35PM +0200, Roman Divacky wrote: > hi, > > as previously discussed on this list I implemented native FreeBSD *at syscalls. > I tried to stick to POSIX draft as I downloaded it on June 21th. (can be found > for free download on posix web site) like 2 minutes after I sent this mail I got a review of an older version of the patch from Robert Watson... it contains some useful stuff so don't bother reviewing this version.. grrr, really great timing :) roman From owner-freebsd-arch@FreeBSD.ORG Wed Jun 27 18:46:36 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 0712316A41F for ; Wed, 27 Jun 2007 18:46:36 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (farley.org [67.64.95.201]) by mx1.freebsd.org (Postfix) with ESMTP id 9E17D13C43E for ; Wed, 27 Jun 2007 18:46:35 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (thor.farley.org [192.168.1.5]) by mail.farley.org (8.14.1/8.14.1) with ESMTP id l5RIUnb0052769 for ; Wed, 27 Jun 2007 13:30:49 -0500 (CDT) (envelope-from scf@FreeBSD.org) Date: Wed, 27 Jun 2007 13:29:23 -0500 (CDT) From: "Sean C. Farley" To: freebsd-arch@FreeBSD.org Message-ID: <20070627130518.M12708@thor.farley.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.1 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on mail.farley.org Cc: Subject: setenv() update in 7-CURRENT time frame 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: Wed, 27 Jun 2007 18:46:36 -0000 With the release rapidly approaching, I want to know if it would be better to move the setenv() (and family) API to POSIX (along with added memory leak restraints). For details on the changes, please see my posting in the current@ and ports@[1] archives. I ask arch@ since it involves API changes. I thought about holding off until the branching, but enough changes have rolled into CURRENT to make me think that it may be acceptable. I received no complaints from my postings in current@ and ports@. From communications with Kris Kennaway, he surmised it may affect a few old BSD-specific ports and checking would have to be done manually to find them. How does the idea of applying my patch[1] to CURRENT before the branch is made sound? While I would prefer it to make it into this release, I understand if it would be best to wait. I am just looking for a definitive answer. If I did not ask, I would feel anxious wondering if it could have made it. :) Sean 1. http://lists.freebsd.org/pipermail/freebsd-ports/2007-May/041577.html 2. http://www.farley.org/freebsd/tmp/setenv/setenv.diff -- scf@FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Wed Jun 27 19:07:39 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 A96A016A400 for ; Wed, 27 Jun 2007 19:07:39 +0000 (UTC) (envelope-from rodrigc@c-71-192-57-29.hsd1.ma.comcast.net) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.200.83]) by mx1.freebsd.org (Postfix) with ESMTP id 732EE13C45E for ; Wed, 27 Jun 2007 19:07:39 +0000 (UTC) (envelope-from rodrigc@c-71-192-57-29.hsd1.ma.comcast.net) Received: from c-71-192-57-29.hsd1.ma.comcast.net ([71.192.57.29]) by comcast.net (sccrmhc13) with ESMTP id <20070627185631013005mtj7e>; Wed, 27 Jun 2007 18:56:32 +0000 Received: from c-71-192-57-29.hsd1.ma.comcast.net (localhost.crodrigues.org [127.0.0.1]) by c-71-192-57-29.hsd1.ma.comcast.net (8.14.1/8.14.1) with ESMTP id l5RIuiXr093223; Wed, 27 Jun 2007 14:56:44 -0400 (EDT) (envelope-from rodrigc@c-71-192-57-29.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-71-192-57-29.hsd1.ma.comcast.net (8.14.1/8.14.1/Submit) id l5RIuiW2093222; Wed, 27 Jun 2007 14:56:44 -0400 (EDT) (envelope-from rodrigc) Date: Wed, 27 Jun 2007 14:56:44 -0400 From: Craig Rodrigues To: "Sean C. Farley" Message-ID: <20070627185644.GB93140@crodrigues.org> References: <20070627130518.M12708@thor.farley.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070627130518.M12708@thor.farley.org> User-Agent: Mutt/1.4.2.2i Cc: freebsd-arch@FreeBSD.org Subject: Re: setenv() update in 7-CURRENT time frame 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: Wed, 27 Jun 2007 19:07:39 -0000 On Wed, Jun 27, 2007 at 01:29:23PM -0500, Sean C. Farley wrote: > Sean > 1. http://lists.freebsd.org/pipermail/freebsd-ports/2007-May/041577.html > 2. http://www.farley.org/freebsd/tmp/setenv/setenv.diff > -- > scf@FreeBSD.org Hi, I support your changes. I was TA'ing a Unix Systems Programming course last year, and it surprised me that when students wrote their assignments using setenv()/putenv() on Linux, that it was different from FreeBSD....in this case, Linux was standards-conformant and FreeBSD was not. It would be nice to make FreeBSD conformant as well. For what it's worth, on OS X/Darwin, it looks like they have made these functions standards conformant as well: char *getenv(const char *); int putenv(char *) __DARWIN_ALIAS(putenv); int setenv(const char *, const char *, int) __DARWIN_ALIAS(setenv); int unsetenv(const char *) __DARWIN_ALIAS(unsetenv); void unsetenv(const char *); -- Craig Rodrigues rodrigc@crodrigues.org From owner-freebsd-arch@FreeBSD.ORG Wed Jun 27 19:44:08 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 2B73A16A41F for ; Wed, 27 Jun 2007 19:44:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id CE5AA13C447 for ; Wed, 27 Jun 2007 19:44:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l5RJi4OM048393; Wed, 27 Jun 2007 15:44:05 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-arch@freebsd.org Date: Wed, 27 Jun 2007 15:43:58 -0400 User-Agent: KMail/1.9.6 References: <20070627130518.M12708@thor.farley.org> In-Reply-To: <20070627130518.M12708@thor.farley.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706271543.59223.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 27 Jun 2007 15:44:05 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3542/Wed Jun 27 12:55:00 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: "Sean C. Farley" Subject: Re: setenv() update in 7-CURRENT time frame 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: Wed, 27 Jun 2007 19:44:08 -0000 On Wednesday 27 June 2007 02:29:23 pm Sean C. Farley wrote: > With the release rapidly approaching, I want to know if it would be > better to move the setenv() (and family) API to POSIX (along with added > memory leak restraints). For details on the changes, please see my > posting in the current@ and ports@[1] archives. I ask arch@ since it > involves API changes. > > I thought about holding off until the branching, but enough changes have > rolled into CURRENT to make me think that it may be acceptable. I > received no complaints from my postings in current@ and ports@. From > communications with Kris Kennaway, he surmised it may affect a few old > BSD-specific ports and checking would have to be done manually to find > them. > > How does the idea of applying my patch[1] to CURRENT before the branch > is made sound? While I would prefer it to make it into this release, I > understand if it would be best to wait. I am just looking for a > definitive answer. If I did not ask, I would feel anxious wondering if > it could have made it. :) > > Sean > 1. http://lists.freebsd.org/pipermail/freebsd-ports/2007-May/041577.html > 2. http://www.farley.org/freebsd/tmp/setenv/setenv.diff > -- > scf@FreeBSD.org Go for it. -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Thu Jun 28 12:29:08 2007 Return-Path: X-Original-To: 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 AC85C16A400 for ; Thu, 28 Jun 2007 12:29:08 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 6027F13C447 for ; Thu, 28 Jun 2007 12:29:07 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 88A5C8BEE12 for ; Thu, 28 Jun 2007 14:29:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kEK9P83d2JqK for ; Thu, 28 Jun 2007 14:29:05 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 561808BEDC5 for ; Thu, 28 Jun 2007 14:29:05 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id l5SCT59F093349 for arch@freebsd.org; Thu, 28 Jun 2007 14:29:05 +0200 (CEST) (envelope-from rdivacky) Date: Thu, 28 Jun 2007 14:29:04 +0200 From: Roman Divacky To: arch@freebsd.org Message-ID: <20070628122904.GA93317@freebsd.org> References: <20070627142935.GA65176@freebsd.org> <20070627145104.GA68910@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070627145104.GA68910@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: semi-final version of *at syscalls patch - new patch 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: Thu, 28 Jun 2007 12:29:08 -0000 On Wed, Jun 27, 2007 at 04:51:04PM +0200, Roman Divacky wrote: > On Wed, Jun 27, 2007 at 04:29:35PM +0200, Roman Divacky wrote: > > hi, > > > > as previously discussed on this list I implemented native FreeBSD *at syscalls. > > I tried to stick to POSIX draft as I downloaded it on June 21th. (can be found > > for free download on posix web site) > > like 2 minutes after I sent this mail I got a review of an older version of the > patch from Robert Watson... it contains some useful stuff so don't bother reviewing > this version.. an updated patch after fixes suggested by Robert is located here: www.vlakno.cz/~rdivacky/linux_at-070628.patch From owner-freebsd-arch@FreeBSD.ORG Thu Jun 28 19:41:28 2007 Return-Path: X-Original-To: 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 A284416A400 for ; Thu, 28 Jun 2007 19:41:28 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 6DDC013C455 for ; Thu, 28 Jun 2007 19:41:28 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.101] (c-71-231-138-78.hsd1.or.comcast.net [71.231.138.78]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id l5SJfQsu032817 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO) for ; Thu, 28 Jun 2007 15:41:27 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Thu, 28 Jun 2007 12:41:15 -0700 (PDT) From: Jeff Roberson X-X-Sender: jroberson@10.0.0.1 To: arch@freebsd.org Message-ID: <20070628123314.W552@10.0.0.1> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Add wakeup_with() before 7.0? 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: Thu, 28 Jun 2007 19:41:28 -0000 I propose to add a new api for wakeup before 7.0. This new api would accept a wait channel and a flags argument. here's the relevant part of the diff: +void wakeup_with(void *chan, int flags) __nonnull(1); +#define WAKEUP_ONE 0x00001 /* Only wakeup on thread. */ +#define WAKEUP_ALL 0x00002 /* Wake-up all waiters. */ +#define WAKEUP_LOCAL 0x00004 /* Wake-up on the local cpu. */ +#define WAKEUP_TAIL 0x00008 /* Wake-up the newest waiter. */ This allows wakeup callers to hint the scheduler about various information. WAKEUP_LOCAL would allow us to prefer affinity for the waking cpu. I have patches to use this in pipe code and socket buffer code that improve performance in some workloads. WAKEUP_TAIL could be used for accept() which I have heard can significantly improve webserver performance. To implement this change sched_wakeup() and setrunnable() need the flags plummed all the way through. I would like feedback on whether people think the api breakage should go in now to enable these optimizations for 7.0, potentially without committing users of these flags right away. Alternatively we could break the api later or just skip it until 8.0. Thanks, Jeff From owner-freebsd-arch@FreeBSD.ORG Thu Jun 28 19:46: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 A318E16A46E; Thu, 28 Jun 2007 19:46:49 +0000 (UTC) (envelope-from kensmith@cse.Buffalo.EDU) Received: from opus.cse.buffalo.edu (opus.cse.Buffalo.EDU [128.205.32.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6A28F13C489; Thu, 28 Jun 2007 19:46:48 +0000 (UTC) (envelope-from kensmith@cse.Buffalo.EDU) Received: from [127.0.0.1] (localhost.cse.buffalo.edu [127.0.0.1]) by opus.cse.buffalo.edu (8.13.8/8.12.4) with ESMTP id l5SJZOBA035974; Thu, 28 Jun 2007 15:35:24 -0400 (EDT) From: Ken Smith To: John Baldwin In-Reply-To: <200706271543.59223.jhb@freebsd.org> References: <20070627130518.M12708@thor.farley.org> <200706271543.59223.jhb@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-C91e8T19DKpTqCjWvlfH" Organization: U. Buffalo CSE Department Date: Thu, 28 Jun 2007 15:35:24 -0400 Message-Id: <1183059324.34788.60.camel@opus.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.10.2 FreeBSD GNOME Team Port Cc: "Sean C. Farley" , freebsd-arch@FreeBSD.org Subject: Re: setenv() update in 7-CURRENT time frame 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: Thu, 28 Jun 2007 19:46:49 -0000 --=-C91e8T19DKpTqCjWvlfH Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2007-06-27 at 15:43 -0400, John Baldwin wrote: > On Wednesday 27 June 2007 02:29:23 pm Sean C. Farley wrote: > > With the release rapidly approaching, I want to know if it would be > > better to move the setenv() (and family) API to POSIX (along with added > > memory leak restraints). For details on the changes, please see my > > posting in the current@ and ports@[1] archives. I ask arch@ since it > > involves API changes. > >=20 > > I thought about holding off until the branching, but enough changes hav= e > > rolled into CURRENT to make me think that it may be acceptable. I > > received no complaints from my postings in current@ and ports@. From > > communications with Kris Kennaway, he surmised it may affect a few old > > BSD-specific ports and checking would have to be done manually to find > > them. > >=20 > > How does the idea of applying my patch[1] to CURRENT before the branch > > is made sound? While I would prefer it to make it into this release, I > > understand if it would be best to wait. I am just looking for a > > definitive answer. If I did not ask, I would feel anxious wondering if > > it could have made it. :) > >=20 > > Sean > > 1. http://lists.freebsd.org/pipermail/freebsd-ports/2007-May/041577.= html > > 2. http://www.farley.org/freebsd/tmp/setenv/setenv.diff > > --=20 > > scf@FreeBSD.org >=20 > Go for it. >=20 Since the last attempt at part of this went badly for a variety of reasons I'm going to give a bit more warning than I'd normally do for a commit approval request during code freeze... :-) Sean has sent the commit request to re@ which given code freeze was the right thing to do. Last time setenv() and friends were made POSIX compliant it sort of blind-sided too many people so I'm going to make sure that doesn't happen this time. Sean's patches look reasonable to me so I'll approve the commit request in a couple of days (likely Saturday). If that's a problem speak now or forever hold your peace... :-) --=20 Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-C91e8T19DKpTqCjWvlfH Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQBGhA18/G14VSmup/YRAkb2AJ4kK/tt1Q+XiTZNWIHQlcteDysiyACfUMKu CyrOg4c8L+XDmKsH/FICKHQ= =RrOr -----END PGP SIGNATURE----- --=-C91e8T19DKpTqCjWvlfH-- From owner-freebsd-arch@FreeBSD.ORG Thu Jun 28 20:53:57 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 7550316A400 for ; Thu, 28 Jun 2007 20:53:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 03C6613C484 for ; Thu, 28 Jun 2007 20:53:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l5SKrkVc058898; Thu, 28 Jun 2007 16:53:46 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-arch@freebsd.org Date: Thu, 28 Jun 2007 16:53:37 -0400 User-Agent: KMail/1.9.6 References: <20070628123314.W552@10.0.0.1> In-Reply-To: <20070628123314.W552@10.0.0.1> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706281653.37930.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 28 Jun 2007 16:53:46 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3546/Thu Jun 28 13:09:58 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Subject: Re: Add wakeup_with() before 7.0? 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: Thu, 28 Jun 2007 20:53:57 -0000 On Thursday 28 June 2007 03:41:15 pm Jeff Roberson wrote: > I propose to add a new api for wakeup before 7.0. This new api would > accept a wait channel and a flags argument. here's the relevant part of > the diff: > > +void wakeup_with(void *chan, int flags) __nonnull(1); > +#define WAKEUP_ONE 0x00001 /* Only wakeup on thread. > */ > +#define WAKEUP_ALL 0x00002 /* Wake-up all waiters. */ > +#define WAKEUP_LOCAL 0x00004 /* Wake-up on the local > cpu. */ > +#define WAKEUP_TAIL 0x00008 /* Wake-up the newest > waiter. */ > > This allows wakeup callers to hint the scheduler about various > information. WAKEUP_LOCAL would allow us to prefer affinity for the > waking cpu. I have patches to use this in pipe code and socket buffer > code that improve performance in some workloads. WAKEUP_TAIL could be > used for accept() which I have heard can significantly improve webserver > performance. > > To implement this change sched_wakeup() and setrunnable() need the flags > plummed all the way through. I would like feedback on whether people > think the api breakage should go in now to enable these optimizations for > 7.0, potentially without committing users of these flags right away. > Alternatively we could break the api later or just skip it until 8.0. We have something like WAKEUP_TAIL (but different, it also prefers non-swapped out processes in addition to taking the most recently suspended thread) at work for accept() and it just modifies the sleepq code's choice in sleepq_signal() of which thread to pick, it doesn't touch any of the scheduler stuff at all. OTOH, I think the scheduler ABIs are ok to change during 7.x as they aren't exposed to any KLD's (no well-behaving ones anyway) as drivers, etc. should all be using higher-level APIs like cv_*() or *sleep(). -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Thu Jun 28 20:59:39 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 BBAFE16A46C; Thu, 28 Jun 2007 20:59:39 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 8512113C457; Thu, 28 Jun 2007 20:59:39 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.101] (c-71-231-138-78.hsd1.or.comcast.net [71.231.138.78]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id l5SKxb4L054125 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Thu, 28 Jun 2007 16:59:38 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Thu, 28 Jun 2007 13:59:25 -0700 (PDT) From: Jeff Roberson X-X-Sender: jroberson@10.0.0.1 To: John Baldwin In-Reply-To: <200706281653.37930.jhb@freebsd.org> Message-ID: <20070628135758.U552@10.0.0.1> References: <20070628123314.W552@10.0.0.1> <200706281653.37930.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@freebsd.org Subject: Re: Add wakeup_with() before 7.0? 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: Thu, 28 Jun 2007 20:59:39 -0000 On Thu, 28 Jun 2007, John Baldwin wrote: > On Thursday 28 June 2007 03:41:15 pm Jeff Roberson wrote: >> I propose to add a new api for wakeup before 7.0. This new api would >> accept a wait channel and a flags argument. here's the relevant part of >> the diff: >> >> +void wakeup_with(void *chan, int flags) __nonnull(1); >> +#define WAKEUP_ONE 0x00001 /* Only wakeup on thread. >> */ >> +#define WAKEUP_ALL 0x00002 /* Wake-up all waiters. */ >> +#define WAKEUP_LOCAL 0x00004 /* Wake-up on the local >> cpu. */ >> +#define WAKEUP_TAIL 0x00008 /* Wake-up the newest >> waiter. */ >> >> This allows wakeup callers to hint the scheduler about various >> information. WAKEUP_LOCAL would allow us to prefer affinity for the >> waking cpu. I have patches to use this in pipe code and socket buffer >> code that improve performance in some workloads. WAKEUP_TAIL could be >> used for accept() which I have heard can significantly improve webserver >> performance. >> >> To implement this change sched_wakeup() and setrunnable() need the flags >> plummed all the way through. I would like feedback on whether people >> think the api breakage should go in now to enable these optimizations for >> 7.0, potentially without committing users of these flags right away. >> Alternatively we could break the api later or just skip it until 8.0. > > We have something like WAKEUP_TAIL (but different, it also prefers non-swapped > out processes in addition to taking the most recently suspended thread) at > work for accept() and it just modifies the sleepq code's choice in > sleepq_signal() of which thread to pick, it doesn't touch any of the > scheduler stuff at all. OTOH, I think the scheduler ABIs are ok to change > during 7.x as they aren't exposed to any KLD's (no well-behaving ones anyway) > as drivers, etc. should all be using higher-level APIs like cv_*() or > *sleep(). In my implementation the WAKEUP_TAIL call just changes the sleepq as well. It doesn't go down to the scheduler. I agree that well behaving drivers should not use setrunnable() or sched_wakeup(). Maybe that is ok to break later. Any other opinions? Jeff > > -- > John Baldwin > From owner-freebsd-arch@FreeBSD.ORG Thu Jun 28 21:28:20 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 538D716A46C for ; Thu, 28 Jun 2007 21:28:20 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by mx1.freebsd.org (Postfix) with ESMTP id D141713C4BB for ; Thu, 28 Jun 2007 21:28:19 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by ug-out-1314.google.com with SMTP id o4so226483uge for ; Thu, 28 Jun 2007 14:28:18 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=q8Te2NL6FRSFc5hTG/jfxA13MIj1zeGBqILW5/stxdeEyQbA3ky+v3oc1ZoBYTN1zwXJ4ffvmUp/JuNVPrJkAyOjMU54cASnfu7WLJ0Ku2/1Z4Jnu+OBr8Bynvg9ck6lutu1qK13RoWk/E+/qzE+qGKJiAPnVXzlPjLC8NcKX+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=sRnDfIEywZkhO5yQO6OKF3PR5RRWkLhEYpnob+mqSNTewQscT28f/Wrh9XYjgBvQzbQ4JOPdZnz+luSfX4V7SqSFg/ZopZRDSwyN7QWCnOkhGuHCbFeZDfFVH31HauqGQWcEHj3w00JpwDp6fZUlz/uEZHD2XwO0HpDKu5xtxBc= Received: by 10.78.138.6 with SMTP id l6mr1201794hud.1183066098595; Thu, 28 Jun 2007 14:28:18 -0700 (PDT) Received: by 10.78.97.18 with HTTP; Thu, 28 Jun 2007 14:28:18 -0700 (PDT) Message-ID: <3bbf2fe10706281428t3543c396q5cb5bb61685a987f@mail.gmail.com> Date: Thu, 28 Jun 2007 23:28:18 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Jeff Roberson" In-Reply-To: <20070628135758.U552@10.0.0.1> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070628123314.W552@10.0.0.1> <200706281653.37930.jhb@freebsd.org> <20070628135758.U552@10.0.0.1> X-Google-Sender-Auth: 06111853b69c9678 Cc: freebsd-arch@freebsd.org Subject: Re: Add wakeup_with() before 7.0? 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: Thu, 28 Jun 2007 21:28:20 -0000 2007/6/28, Jeff Roberson : > On Thu, 28 Jun 2007, John Baldwin wrote: > > > On Thursday 28 June 2007 03:41:15 pm Jeff Roberson wrote: > >> I propose to add a new api for wakeup before 7.0. This new api would > >> accept a wait channel and a flags argument. here's the relevant part of > >> the diff: > >> > >> +void wakeup_with(void *chan, int flags) __nonnull(1); > >> +#define WAKEUP_ONE 0x00001 /* Only wakeup on thread. > >> */ > >> +#define WAKEUP_ALL 0x00002 /* Wake-up all waiters. */ > >> +#define WAKEUP_LOCAL 0x00004 /* Wake-up on the local > >> cpu. */ > >> +#define WAKEUP_TAIL 0x00008 /* Wake-up the newest > >> waiter. */ > >> > >> This allows wakeup callers to hint the scheduler about various > >> information. WAKEUP_LOCAL would allow us to prefer affinity for the > >> waking cpu. I have patches to use this in pipe code and socket buffer > >> code that improve performance in some workloads. WAKEUP_TAIL could be > >> used for accept() which I have heard can significantly improve webserver > >> performance. > >> > >> To implement this change sched_wakeup() and setrunnable() need the flags > >> plummed all the way through. I would like feedback on whether people > >> think the api breakage should go in now to enable these optimizations for > >> 7.0, potentially without committing users of these flags right away. > >> Alternatively we could break the api later or just skip it until 8.0. > > > > We have something like WAKEUP_TAIL (but different, it also prefers non-swapped > > out processes in addition to taking the most recently suspended thread) at > > work for accept() and it just modifies the sleepq code's choice in > > sleepq_signal() of which thread to pick, it doesn't touch any of the > > scheduler stuff at all. OTOH, I think the scheduler ABIs are ok to change > > during 7.x as they aren't exposed to any KLD's (no well-behaving ones anyway) > > as drivers, etc. should all be using higher-level APIs like cv_*() or > > *sleep(). > > In my implementation the WAKEUP_TAIL call just changes the sleepq as well. > It doesn't go down to the scheduler. I agree that well behaving drivers > should not use setrunnable() or sched_wakeup(). Maybe that is ok to > break later. Any other opinions? 1) I would like to call the function wakeup_flags() as wakeup_with() is not approprate IMHO 2) I would commit just for 8.0 since currently there is no real consumer of it. For 8.0 we can have time to rework the accept code in order to use it 3) Is the code of wakeup_with() alredy available? Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-freebsd-arch@FreeBSD.ORG Fri Jun 29 00:36:00 2007 Return-Path: X-Original-To: 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 74DBC16A421 for ; Fri, 29 Jun 2007 00:36:00 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 2B1C713C45A; Fri, 29 Jun 2007 00:36:00 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from [127.0.0.1] (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5T0Zwru042982; Fri, 29 Jun 2007 00:35:59 GMT (envelope-from davidxu@freebsd.org) Message-ID: <46845414.609@freebsd.org> Date: Fri, 29 Jun 2007 08:36:36 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20070516 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Roberson References: <20070628123314.W552@10.0.0.1> In-Reply-To: <20070628123314.W552@10.0.0.1> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org Subject: Re: Add wakeup_with() before 7.0? 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: Fri, 29 Jun 2007 00:36:00 -0000 Jeff Roberson wrote: > I propose to add a new api for wakeup before 7.0. This new api would > accept a wait channel and a flags argument. here's the relevant part of > the diff: > > +void wakeup_with(void *chan, int flags) __nonnull(1); > +#define WAKEUP_ONE 0x00001 /* Only wakeup on > thread. */ > +#define WAKEUP_ALL 0x00002 /* Wake-up all waiters. */ > +#define WAKEUP_LOCAL 0x00004 /* Wake-up on the local > cpu. */ > +#define WAKEUP_TAIL 0x00008 /* Wake-up the newest > waiter. */ > > This allows wakeup callers to hint the scheduler about various > information. WAKEUP_LOCAL would allow us to prefer affinity for the > waking cpu. I have patches to use this in pipe code and socket buffer > code that improve performance in some workloads. WAKEUP_TAIL could be > used for accept() which I have heard can significantly improve webserver > performance. > Add my 1 cent here, AFAIK WAKEUP_LOCAL means the current thread will sleep or give up cpu soon, so there is no needs to wake up a thread on another cpu, right ? > To implement this change sched_wakeup() and setrunnable() need the flags > plummed all the way through. I would like feedback on whether people > think the api breakage should go in now to enable these optimizations > for 7.0, potentially without committing users of these flags right away. > Alternatively we could break the api later or just skip it until 8.0. > > Thanks, > Jeff From owner-freebsd-arch@FreeBSD.ORG Fri Jun 29 01:05:58 2007 Return-Path: X-Original-To: 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 40FFD16A469 for ; Fri, 29 Jun 2007 01:05:58 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 33CFF13C447 for ; Fri, 29 Jun 2007 01:05:58 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id B1CD41A4D94; Thu, 28 Jun 2007 18:04:27 -0700 (PDT) Date: Thu, 28 Jun 2007 18:04:27 -0700 From: Alfred Perlstein To: Jeff Roberson Message-ID: <20070629010427.GB22054@elvis.mu.org> References: <20070628123314.W552@10.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070628123314.W552@10.0.0.1> User-Agent: Mutt/1.4.2.3i Cc: arch@freebsd.org Subject: Re: Add wakeup_with() before 7.0? 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: Fri, 29 Jun 2007 01:05:58 -0000 This would be very useful, if you have time it might make sense to do this for condvars as well. At the minimum you should fix the comment for WAKEUP_ONE to be "Only wakeup _one_ thread". * Jeff Roberson [070628 12:40] wrote: > I propose to add a new api for wakeup before 7.0. This new api would > accept a wait channel and a flags argument. here's the relevant part of > the diff: > > +void wakeup_with(void *chan, int flags) __nonnull(1); > +#define WAKEUP_ONE 0x00001 /* Only wakeup on thread. > */ > +#define WAKEUP_ALL 0x00002 /* Wake-up all waiters. */ > +#define WAKEUP_LOCAL 0x00004 /* Wake-up on the local > cpu. */ > +#define WAKEUP_TAIL 0x00008 /* Wake-up the newest > waiter. */ > > This allows wakeup callers to hint the scheduler about various > information. WAKEUP_LOCAL would allow us to prefer affinity for the > waking cpu. I have patches to use this in pipe code and socket buffer > code that improve performance in some workloads. WAKEUP_TAIL could be > used for accept() which I have heard can significantly improve webserver > performance. > > To implement this change sched_wakeup() and setrunnable() need the flags > plummed all the way through. I would like feedback on whether people > think the api breakage should go in now to enable these optimizations for > 7.0, potentially without committing users of these flags right away. > Alternatively we could break the api later or just skip it until 8.0. > > Thanks, > Jeff > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" -- - Alfred Perlstein From owner-freebsd-arch@FreeBSD.ORG Fri Jun 29 01:07:34 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 1615C16A476 for ; Fri, 29 Jun 2007 01:07:34 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 0364613C44C for ; Fri, 29 Jun 2007 01:07:33 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 994B71A4D94; Thu, 28 Jun 2007 18:06:03 -0700 (PDT) Date: Thu, 28 Jun 2007 18:06:03 -0700 From: Alfred Perlstein To: Attilio Rao Message-ID: <20070629010603.GC22054@elvis.mu.org> References: <20070628123314.W552@10.0.0.1> <200706281653.37930.jhb@freebsd.org> <20070628135758.U552@10.0.0.1> <3bbf2fe10706281428t3543c396q5cb5bb61685a987f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bbf2fe10706281428t3543c396q5cb5bb61685a987f@mail.gmail.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-arch@freebsd.org Subject: Re: Add wakeup_with() before 7.0? 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: Fri, 29 Jun 2007 01:07:34 -0000 * Attilio Rao [070628 14:30] wrote: > > 1) I would like to call the function wakeup_flags() as wakeup_with() > is not approprate IMHO Yes, I forgot about this, _flags is a much better suffix. -- - Alfred Perlstein From owner-freebsd-arch@FreeBSD.ORG Fri Jun 29 01:18:07 2007 Return-Path: X-Original-To: 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 BB37816A400 for ; Fri, 29 Jun 2007 01:18:07 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 803DE13C447 for ; Fri, 29 Jun 2007 01:18:07 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id AFFD54773F; Thu, 28 Jun 2007 21:00:04 -0400 (EDT) Date: Fri, 29 Jun 2007 02:00:04 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Jeff Roberson In-Reply-To: <20070628123314.W552@10.0.0.1> Message-ID: <20070629015656.I50751@fledge.watson.org> References: <20070628123314.W552@10.0.0.1> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org Subject: Re: Add wakeup_with() before 7.0? 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: Fri, 29 Jun 2007 01:18:07 -0000 On Thu, 28 Jun 2007, Jeff Roberson wrote: > I propose to add a new api for wakeup before 7.0. This new api would accept > a wait channel and a flags argument. here's the relevant part of the diff: > > +void wakeup_with(void *chan, int flags) __nonnull(1); > +#define WAKEUP_ONE 0x00001 /* Only wakeup on thread. */ > +#define WAKEUP_ALL 0x00002 /* Wake-up all waiters. */ > +#define WAKEUP_LOCAL 0x00004 /* Wake-up on the local cpu. What will this flag do if there are no sleepers on the current CPU, but there are sleepers on other CPUs? > */ > +#define WAKEUP_TAIL 0x00008 /* Wake-up the newest waiter. > */ Another flag I've played with adding in the past has been WAKEUP_NOPREEMPT, which would hint to the scheduler that a brief priority inversion is preferred to excessive context switching. > To implement this change sched_wakeup() and setrunnable() need the flags > plummed all the way through. I would like feedback on whether people think > the api breakage should go in now to enable these optimizations for 7.0, > potentially without committing users of these flags right away. > Alternatively we could break the api later or just skip it until 8.0. I've not looked at the details here, but my general feeling is that if we think that making the API change now is low-risk (i.e., won't be error-prone), and we think it's very unlikely we might want to further revise them, I'm OK with it happening before the branch. I think I wouldn't expose the flags themselves at this point in 7.x, just the function prototype change. Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-arch@FreeBSD.ORG Fri Jun 29 08:53:08 2007 Return-Path: X-Original-To: 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 0993E16A47D for ; Fri, 29 Jun 2007 08:53:08 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id C00C613C45A for ; Fri, 29 Jun 2007 08:53:07 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id B159420B0; Fri, 29 Jun 2007 10:53:03 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.0 (2007-05-01) on tim.des.no Received: from dwp.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id A44C320AF; Fri, 29 Jun 2007 10:53:03 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 1001) id 64E195F68; Fri, 29 Jun 2007 10:53:03 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jeff Roberson References: <20070628123314.W552@10.0.0.1> Date: Fri, 29 Jun 2007 10:53:03 +0200 In-Reply-To: <20070628123314.W552@10.0.0.1> (Jeff Roberson's message of "Thu\, 28 Jun 2007 12\:41\:15 -0700 \(PDT\)") Message-ID: <86ejjvyweo.fsf@dwp.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org Subject: Re: Add wakeup_with() before 7.0? 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: Fri, 29 Jun 2007 08:53:08 -0000 Jeff Roberson writes: > This allows wakeup callers to hint the scheduler about various > information. WAKEUP_LOCAL would allow us to prefer affinity for the > waking cpu. I have patches to use this in pipe code and socket buffer > code that improve performance in some workloads. WAKEUP_TAIL could be > used for accept() which I have heard can significantly improve > webserver performance. Yes, for accept() and other situations where the sleepers are otherwise equivalent (i.e. you don't care *who* is woken up as long as *somebody* is woken up), picking the most recent entry on the sleep queue (the entry which is most likely to still be in cache, or at least not paged out) will greatly reduce cache and VM thrashing. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no