From owner-freebsd-stable@FreeBSD.ORG Tue Apr 4 16:08:15 2006 Return-Path: X-Original-To: freebsd-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 ADFB616A424 for ; Tue, 4 Apr 2006 16:08:15 +0000 (UTC) (envelope-from craig@feniz.gank.org) Received: from ion.gank.org (ion.gank.org [69.55.238.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C79D43D55 for ; Tue, 4 Apr 2006 16:08:14 +0000 (GMT) (envelope-from craig@feniz.gank.org) Received: by ion.gank.org (Postfix, from userid 1001) id C2BC7115D3; Tue, 4 Apr 2006 11:08:13 -0500 (CDT) Date: Tue, 4 Apr 2006 11:08:11 -0500 From: Craig Boston To: Vivek Khera Message-ID: <20060404160810.GA25106@nowhere> Mail-Followup-To: Craig Boston , Vivek Khera , freebsd-stable References: <20060403140902.C947@ganymede.hub.org> <20060403182504.S76562@fledge.watson.org> <20060403144916.J947@ganymede.hub.org> <20060403230850.P76562@fledge.watson.org> <20060403205630.N947@ganymede.hub.org> <136F2379-153C-4013-BEC1-2BBA36129810@khera.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline In-Reply-To: <136F2379-153C-4013-BEC1-2BBA36129810@khera.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-stable Subject: Re: [HACKERS] semaphore usage "port based"? 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: Tue, 04 Apr 2006 16:08:15 -0000 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 04, 2006 at 10:17:18AM -0400, Vivek Khera wrote: > Perhaps you can hack into the postgresql master a flag that alters > the "1000" parameter, or starts at a port * 1000 + N, then hard-code > that flag into your startup script per jail. A quick and dirty hack to fudge with the requested semid (and shared memroy identifier) is attached. Replace XXX with an arbitrary number. It would be better if this was configurable, but doing it that way works well enough for what I need, and may at least give an idea where to start on a better workaround. Craig --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch-postgresql-shmem --- src/backend/storage/ipc/ipci.c.orig Tue Feb 28 10:09:23 2006 +++ src/backend/storage/ipc/ipci.c Tue Feb 28 10:09:38 2006 @@ -102,14 +102,14 @@ /* * Create the shmem segment */ - seghdr = PGSharedMemoryCreate(size, makePrivate, port); + seghdr = PGSharedMemoryCreate(size, makePrivate, port + XXX); /* * Create semaphores */ numSemas = ProcGlobalSemas(); numSemas += SpinlockSemas(); - PGReserveSemaphores(numSemas, port); + PGReserveSemaphores(numSemas, port + XXX); } else { --Kj7319i9nmIyA2yE--