Re: aio: worker: Free SMGR objects when idle - Mailing list pgsql-hackers

From shihao zhong
Subject Re: aio: worker: Free SMGR objects when idle
Date
Msg-id CAGRkXqToSdggTG7q9yBh0NRaD8jrtE2PxMRj=G3mS3Fv2fE+UA@mail.gmail.com
Whole thread
In response to Re: aio: worker: Free SMGR objects when idle  (Nazir Bilal Yavuz <byavuz81@gmail.com>)
Responses Re: aio: worker: Free SMGR objects when idle
List pgsql-hackers
Hi Nazir,

On the entry count. Nothing is pinned in an IO worker, only the
relcache calls smgrpin(), which also answers Alexandre's question. So
the unpinned count is just hash_get_num_entries(), and that only reads
a counter. SMgrRelationHash is local and not partitioned. The IO
counter is fine with me too though.

One gap in v2. v1 cleaned up when the worker went idle, v2 does not.
A worker that does fewer than 1024 IOs and then sleeps keeps those
entries and their descriptors until it gets busy again.  #19622 has
that case, workers idle for 51 minutes still holding descriptors of
dropped tables. Maybe also clean up in the idle branch when
ios_since_smgr_cleanup > 0. That needs no lock either.

Thanks,
Shihao

pgsql-hackers by date:

Previous
From: shihao zhong
Date:
Subject: Re: REPACK (CONCURRENTLY) can silently lose updates when the toast table is rewritten
Next
From: Heikki Linnakangas
Date:
Subject: Re: [PATCH] Two remaining shmem attachment issues in single-user mode