1 Feb 03:39
Re: CLOG contention, part 2
Jeff Janes <jeff.janes <at> gmail.com>
2012-02-01 02:39:58 GMT
2012-02-01 02:39:58 GMT
On Mon, Jan 30, 2012 at 12:24 PM, Robert Haas <robertmhaas <at> gmail.com> wrote: > On Fri, Jan 27, 2012 at 8:21 PM, Jeff Janes <jeff.janes <at> gmail.com> wrote: >> On Fri, Jan 27, 2012 at 3:16 PM, Merlin Moncure <mmoncure <at> gmail.com> wrote: >>> On Fri, Jan 27, 2012 at 4:05 PM, Jeff Janes <jeff.janes <at> gmail.com> wrote: >>>> Also, I think the general approach is wrong. The only reason to have >>>> these pages in shared memory is that we can control access to them to >>>> prevent write/write and read/write corruption. Since these pages are >>>> never written, they don't need to be in shared memory. Just read >>>> each page into backend-local memory as it is needed, either >>>> palloc/pfree each time or using a single reserved block for the >>>> lifetime of the session. Let the kernel worry about caching them so >>>> that the above mentioned reads are cheap. >>> >>> right -- exactly. but why stop at one page? >> >> If you have more than one, you need code to decide which one to evict >> (just free) every time you need a new one. And every process needs to >> be running this code, while the kernel is still going to need make its >> own decisions for the entire system. It seems simpler to just let the >> kernel do the job for everyone. Are you worried that a read syscall >> is going to be slow even when the data is presumably cached in the OS? > > I think that would be a very legitimate worry. You're talking about > copying 8kB of data because you need two bits. Even if the > user/kernel mode context switch is lightning-fast, that's a lot of > extra data copying. I guess the most radical step in the direction I am advocating would be to simply read the one single byte with the data you want. Very little copying, but then the odds of the next thing you want being on(Continue reading)
RSS Feed