Re: Need help with phys backed shm segments (Postgresql+FreeBSD).

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Alfred Perlstein <bright(at)wintelcom(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Need help with phys backed shm segments (Postgresql+FreeBSD).
Date: 2000-12-05 21:20:52
Message-ID: Pine.GSO.3.96.SK.1001206001907.4327u-100000@ra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alfred,

do you have any numbers with and without your patch ?
I mean performance. You may use pg_check utility.

Oleg
On Tue, 5 Dec 2000, Alfred Perlstein wrote:

> Date: Tue, 5 Dec 2000 13:04:45 -0800
> From: Alfred Perlstein <bright(at)wintelcom(dot)net>
> To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> Cc: pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] Need help with phys backed shm segments (Postgresql+FreeBSD).
>
> * Alfred Perlstein <bright(at)wintelcom(dot)net> [001205 12:30] wrote:
> > * Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [001205 08:37] wrote:
> > > BTW, I just remembered that in 7.0.*, the SLocks that are managed by
> > > SpinAcquire() all live in their own little shm segment. On a machine
> > > where slock_t is char, it'd likely only amount to 128 bytes or so.
> > > Maybe you are seeing some bug in FreeBSD's handling of tiny shm
> > > segments?
> >
> > Good call, i think I found it! :)
>
> Here's the patch I'm using on FreeBSD, it seems to work, if any
> other FreeBSD'ers want to try it out, just apply the patch:
> cd /usr/src/sys/vm ; patch < patchfile
>
> and recompile and boot with a new kernel, then do this:
>
> sysctl -w kern.ipc.shm_use_phys=1
>
> or add:
> kern.ipc.shm_use_phys=1
> to /etc/sysctl.conf
>
> Let me know if it works.
>
> thanks,
> -Alfred
>
> Index: phys_pager.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/vm/phys_pager.c,v
> retrieving revision 1.3.2.1
> diff -u -u -r1.3.2.1 phys_pager.c
> --- phys_pager.c 2000/08/04 22:31:11 1.3.2.1
> +++ phys_pager.c 2000/12/05 20:13:25
> @@ -83,7 +83,7 @@
> * Allocate object and associate it with the pager.
> */
> object = vm_object_allocate(OBJT_PHYS,
> - OFF_TO_IDX(foff + size));
> + OFF_TO_IDX(foff + PAGE_MASK + size));
> object->handle = handle;
> TAILQ_INSERT_TAIL(&phys_pager_object_list, object,
> pager_object_list);
>

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Myers 2000-12-05 21:22:26 Re: beta testing version
Previous Message Tom Lane 2000-12-05 21:19:52 Re: copy from stdin limits