From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 23 19:52:45 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5346C106568D; Mon, 23 Feb 2009 19:52:45 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mxout3.cac.washington.edu (mxout3.cac.washington.edu [140.142.32.166]) by mx1.freebsd.org (Postfix) with ESMTP id 26B488FC08; Mon, 23 Feb 2009 19:52:45 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout3.cac.washington.edu (8.14.3+UW08.09/8.14.3+UW09.01) with ESMTP id n1NJqi9l017393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Feb 2009 11:52:44 -0800 X-Auth-Received: from [192.168.10.7] (adsl-99-170-148-198.dsl.pltn13.sbcglobal.net [99.170.148.198]) (authenticated authid=youshi10) by smtp.washington.edu (8.14.3+UW08.09/8.14.3+UW09.01) with ESMTP id n1NJqhK9012855 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 23 Feb 2009 11:52:43 -0800 Message-Id: <78AACD88-3F94-4B39-9122-9C4199DFFDBA@gmail.com> From: Garrett Cooper To: Christian Peron In-Reply-To: <20090223190828.GA34866@jnz.sqrt.ca> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Mon, 23 Feb 2009 11:58:09 -0800 References: <1235404207.31655.2085.camel@soundwave.ws.pitbpa0.priv.collaborativefusion.com> <20090223190828.GA34866@jnz.sqrt.ca> X-Mailer: Apple Mail (2.930.3) X-PMX-Version: 5.5.0.356843, Antispam-Engine: 2.6.1.350677, Antispam-Data: 2009.2.23.194324 X-Uwash-Spam: Gauge=XII, Probability=12%, Report='URI_HOSTNAME_CONTAINS_EQUALS 1, FORGED_FROM_GMAIL 0.1, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __BOUNCE_CHALLENGE_SUBJ 0, __C230066_P5 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_419_WEBMAIL 0, __FRAUD_419_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0' Cc: Kirk Strauser , freebsd-hackers@freebsd.org, "Brian A. Seklecki" , wmoran@potentialtech.com Subject: Re: shmmax tops out at 2G? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 19:52:45 -0000 On Feb 23, 2009, at 11:08 AM, Christian Peron wrote: > This issue has come up a number of times. I was looking into fixing > this but I > just have not had the time. The basic issue is our shmid_ds > structure: > > struct shmid_ds { > struct ipc_perm shm_perm; /* operation permission > structure */ > int shm_segsz; /* size of segment in bytes */ > pid_t shm_lpid; /* process ID of last shared > memory op */ > pid_t shm_cpid; /* process ID of creator */ > short shm_nattch; /* number of current attaches */ > time_t shm_atime; /* time of last shmat() */ > time_t shm_dtime; /* time of last shmdt() */ > time_t shm_ctime; /* time of last change by > shmctl() */ > void *shm_internal; /* sysv stupidity */ > }; > > > Basically the shm_segsz member needs to be switched from 32 bits > (int) to > 64 bits. The problem is that this breaks the ABI and older versions > of > postgresql will not work. The solution is to add additional syscalls. > > However, everytime this issue comes up, the question on whether we > should > fix struct ipc_perm at the same time is asked. The answer imho is > that > we should, however this is more complex since semaphores, messaages > and > shared memory segments all use it. > > The fixes are straight forward, however making sure we maintain > reverse > compatability is where things become complicated, especially since > there > are multiple layers of reverse compat we need to look after. > > > On Mon, Feb 23, 2009 at 10:50:07AM -0500, Brian A. Seklecki wrote: >>> On Wed, 2006-Dec-13 10:50:21 -0500, Bill Moran wrote: >>>> In response to Bill Moran : >>>>> sysctl kern.ipc.shmmax=2200000000 >>>>> kern.ipc.shmmax: 2100000000 -> -2094967296 >> >> Someone was nice enough to file a PR related to this: >> >> http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/130274 >> >> We'd be happy to sponsor development in -current to address this >> limitation. ~BAS Why isn't the field an unsigned int / size_t? I don't see much value in having the size be signed... -Garrett