AW: portfs and port_send_event

From: Noveljic Nenad <nenad.noveljic_at_vontobel.com>
Date: Sun, 15 Apr 2018 09:27:02 +0000
Message-ID: <23263_1523784436_5AD31AF4_23263_5557_1_ECDEF0CC6716EC4596FCBC871F48292AB1998654_at_ZRH-S231>



Yes, you‘ve hit the nail on the head - the Solaris port event framework is meant to be a more efficient substitute for semaphores and polling event completion. Sadly, its documentation leaves something to be desired.

Actually, I was wondering whether it’s possible to figure out who is posting whom by looking into the port event function parameters. I didn‘t have any particular problem in mind, I was rather doing it just for fun, so to speak.

Meanwhile, I watched Tanel Porder‘s hacking session recording https://blog.tanelpoder.com/2018/01/11/secret-hacking-session-oracle-background-process-communication-exotic-wait-events-and-some-tracing-too/ and learned that the message exchange between processes is being captured in x$trace. Of course, this is a much better place to look for this kind of information than analyzing low level OS calls.

Best regards,

Nenad

http://nenadnoveljic.com/blog/

Von: Frits Hoogland <frits.hoogland_at_gmail.com<mailto:frits.hoogland_at_gmail.com>> Datum Samstag, 14. Apr. 2018, 4:51 PM
An: Noveljic Nenad <nenad.noveljic_at_vontobel.com<mailto:nenad.noveljic_at_vontobel.com>> Cc: ORACLE-L (oracle-l_at_freelists.org) <oracle-l_at_freelists.org<mailto:oracle-l_at_freelists.org>> Betreff: Re: portfs and port_send_event

I am not familiar with these functions.
It seems this port event framework is a solaris only thing, used as a substitute for semaphores, obviously because oracle thinks they have better performance or scale better. (actually they seem to say it’s mostly a substitute for polling event completion). There are multiple blogposts explaining them, telling essentially that.

What is it that you need to know?
port_send_event seems to send something, the address is probably a pointer to a struct, and I am quite sure a foreground that has committed is the receiver of it, because that is what the function of sskgpwpost does. So that would be equivalent of semop on linux, posting the semaphore on which a foreground is sleeping, waiting for the logwriter to get notified the redo write has finished.

I don’t know the port event framework, but if you look at what happens when multiple processes need posting on a semaphore on linux, another function (sskgpwvectorpost) is executed and still all processes are posted serially, maybe the event framework can post them all at once. Again, I don’t know the port event framework, this might not be true, but this is the one of the problems that the port event framework is documented to solve.

And the database implemented a solution for this already, which is “polling mode”, which doesn’t require any communication from the logwriter to a waiting foreground after writing, because the foreground checks writing progress itself.

Frits Hoogland

http://fritshoogland.wordpress.com<http://fritshoogland.wordpress.com/> frits.hoogland_at_gmail.com<mailto:frits.hoogland_at_gmail.com> Mobile: +31 6 14180860

On 12 Apr 2018, at 10:39, Noveljic Nenad <nenad.noveljic_at_vontobel.com<mailto:nenad.noveljic_at_vontobel.com>> wrote:

Is somebody familiar with the specification of Oracle Solaris kernel functions portfs and port_send_event?

These functions are a part of the Solaris Event Completion framework. This framework seems to be used instead of semaphores for posting messages between processes on the Solaris implementation of Oracle.

Here is an example of a call stack within the lgwr process:

port_send_event(FFFFA22B765EFBA8)

              libc.so.1`_portfs+0xa
              oracle`sskgpwpost+0xf0
              oracle`kslpsprns+0x19c
              oracle`kcrfw_slave_queue_insert+0x361
              oracle`kcrfw_redo_write_driver+0x73e
              oracle`ksbabs+0x15c4
              oracle`ksbrdp+0x4ce
              oracle`opirip+0x2cd
              oracle`opidrv+0x24a
              oracle`sou2o+0x64
              oracle`opimai_real+0x9f
              oracle`ssthrdmain+0x21d
              oracle`main+0x94
              oracle`0xabcb95b

While the other port_* functions are well documented (see https://docs.oracle.com/cd/E86824_01/html/E54766/port-send-3c.html#scrolltoc ) these two are completely missing despite being heavily used.

Best regards,

Nenad

http://nenadnoveljic.com/blog/



Please consider the environment before printing this e-mail. Bitte denken Sie an die Umwelt, bevor Sie dieses E-Mail drucken.

Important Notice

This message is intended only for the individual named. It may contain confidential or privileged information. If you are not the named addressee you should in particular not disseminate, distribute, modify or copy this e-mail. Please notify the sender immediately by e-mail, if you have received this message by mistake and delete it from your system.

E-mail transmission may not be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete. Also processing of incoming e-mails cannot be guaranteed. All liability of the Vontobel Group and its affiliates for any damages resulting from e-mail use is excluded. You are advised that urgent and time sensitive messages should not be sent by e-mail and if verification is required please request a printed version.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">p { font-family: Arial;font-size:9pt }</style>
</head>
<body>
<p>
<br>Important Notice</br>
<br>This message is intended only for the individual named. It may contain confidential or privileged information. If you are not the named addressee you should in particular not disseminate, distribute, modify or copy this e-mail. Please notify the sender immediately by e-mail, if you have received this message by mistake and delete it from your system.</br>
<br>E-mail transmission may not be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete. Also processing of incoming e-mails cannot be guaranteed. All liability of the Vontobel Group and its affiliates for any damages resulting from e-mail use is excluded. You are advised that urgent and time sensitive messages should not be sent by e-mail and if verification is required please request a printed version.<br/>
</p>
</body>
</html>

--
http://www.freelists.org/webpage/oracle-l
Received on Sun Apr 15 2018 - 11:27:02 CEST

Original text of this message