Re: NOFIXADE / NOPRINTADE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: NOFIXADE / NOPRINTADE
Дата
Msg-id 25886.1095950123@sss.pgh.pa.us
обсуждение исходный текст
Ответ на NOFIXADE / NOPRINTADE  (Neil Conway <neilc@samurai.com>)
Ответы Re: NOFIXADE / NOPRINTADE  (Neil Conway <neilc@samurai.com>)
Список pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> Does anyone have any idea what this code is intended to do, and why it
> is necessary?

A bit of googling (I used "SSIN_UACPROC") will turn up enough info to
clue you in.  Apparently, on these machines an unaligned memory access
causes a trap to the kernel, but the default behavior of the kernel is
to emulate the desired memory access and then return control.  Fine,
but *really* *slow*.  So good programming practice is to disable the
emulation and fix any thereby-revealed bugs in your code instead.
Which is what we're doing in this code.

The UAC_SIGBUS option turns off the emulation and makes an unaligned
access result in SIGBUS instead.  The UAC_NOPRINT option suppresses
the "unaligned access" warning message that the kernel may helpfully
print about it.  I'm not sure why we have the latter as dead code
(it is dead, because NOPRINTADE doesn't get defined anywhere).
The code samples I found on the net mostly tended to goint    buffer[] = {SSIN_UACPROC, UAC_SIGBUS | UAC_NOPRINT};

I would be inclined to get rid of the separate NOPRINTADE code and make
NOFIXADE select both flags.

The MIPS_FIXADE seems to be the same deal but a different OS' API.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG: possible busy loop when connection is closed while trying to establish SSL connection
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Use of zlib