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

From Nazir Bilal Yavuz
Subject aio: worker: Free SMGR objects when idle
Date
Msg-id CAN55FZ2BesKUnajdgpw1fPSe3S6_CHOugryaUEtD7vdP=dRKEQ@mail.gmail.com
Whole thread
Responses Re: aio: worker: Free SMGR objects when idle
List pgsql-hackers
Hi,

IO worker processes call smgropen with smgr_aio_reopen() -> smgropen()
path. smgropen() has a comment mentioning:

/*
 * If this function is called
 * outside of a transaction, the object remains valid until smgrdestroy() or
 * smgrdestroyall() is called.
/*

Since, IO workers call this function outside of a transaction,
smgrdestroy() needs to be called. Attached patch calls smgrdestroy()
when the IO worker is idle. There is a chance that IO workers won't be
idle forever, so we might want to trigger this after #n number of IOs
too but I didn't implement like that for the sake of simplicity.

-- 
Regards,
Nazir Bilal Yavuz
Microsoft

Attachment

pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: meson vs. llvm bitcode files
Next
From: Ajin Cherian
Date:
Subject: Re: table-write trigger can bypass ATPrepChangePersistence