Re: Patch: add timing of buffer I/O requests

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: Patch: add timing of buffer I/O requests
Дата
Msg-id 4ED432BC.5050409@fuzzy.cz
обсуждение исходный текст
Ответ на Re: Patch: add timing of buffer I/O requests  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Список pgsql-hackers
On 28.11.2011 22:32, Dimitri Fontaine wrote:
> "Tomas Vondra" <tv@fuzzy.cz> writes:
>> Another option would be to reimplement the vsyscall, even on platforms
>> that don't provide it. The principle is actually quite simple - allocate a
>> shared memory, store there a current time and update it whenever a clock
>> interrupt happens. This is basically what Greg suggested in one of the
>> previous posts, where "regularly" means "on every interrupt". Greg was
>> worried about the precision, but this should be just fine I guess. It's
>> the precision you get on Linux, anyway ...
> 
> That sounds good for other interesting things, which entails being able
> to have timing information attached to the XID sequence.  If we go this
> way, how far are we from having a ticker in PostgreSQL?

I'm not sure. On Linux/x86 this is already done, but my knowledge of
kernel development is rather limited, especially when it comes to other
OSes and platforms. E.g. I'm not sure why it's not available in FreeBSD
on x86, I guess it's rather "we don't want it" than "it's not possible."


In Linux sources, the most interesting pieces are probably these:

1) arch/x86/include/asm/vgtod.h - that's the shared memory structure

2) arch/x86/kernel/vsyscall_64.c - this is how the memory is read                                  (do_vgettimeofday)

3) arch/x86/kernel/vsyscall_64.c - this is how the memory is updated
(update_vsyscall)

4) kernel/time/timekeeping.c - do_settimeofday (calls update_vsyscall)

5) drivers/rtc/class.c (and other) RTC drivers call do_settimeofday


Tomas


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Patch: add timing of buffer I/O requests
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Patch: add timing of buffer I/O requests