Re: Attach to shared memory after fork() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Attach to shared memory after fork()
Date
Msg-id 2616865.1619531485@sss.pgh.pa.us
Whole thread Raw
In response to Attach to shared memory after fork()  ("邱宇航(烛远)" <yuhang.qyh@alibaba-inc.com>)
List pgsql-hackers
"=?UTF-8?B?6YKx5a6H6IiqKOeDm+i/nCk=?=" <yuhang.qyh@alibaba-inc.com> writes:
> Fork is an expensive operation[1].

Yeah, it's not hugely cheap.

> So I propose to remove shared buffers from postmaster and shmat them
> after fork.

This proposal seems moderately insane.  In the first place, it
introduces failure modes we could do without, and in the second place,
how is it not strictly *more* expensive than what happens now?  You
still have to end up with all those TLB entries mapped in the child.

(If your kernel is unable to pass down shared-memory TLBs effectively,
ISTM that's a kernel shortcoming not a Postgres architectural problem.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Performance degradation of REFRESH MATERIALIZED VIEW
Next
From: Bharath Rupireddy
Date:
Subject: Re: Performance degradation of REFRESH MATERIALIZED VIEW