struct sigqueue {
struct sigqueue *next;
struct sigqueue **fsig;
siginfo_t info;
};
struct fown_struct {
int pid; /* pid or -pgrp where SIGIO should be sent */
uid_t uid, euid; /* uid/euid of process setting the owner */
int signum; /* posix.1b rt signal to be delivered on IO */
struct sigqueue *sig_hint;
};
At the end we'll have ( where fsig = &file->fown.sig_hint ) :
static int send_signal_hint(int sig, struct siginfo *info,
struct sigpending *signals, struct sigqueue **fsig) {
if (*fsig != NULL)
merge_info(&(*fsig)->info, info);
else {
*fsig = allog_sig_queue();
(*fsig)->fsig = fsig;
copy_info(&(*fsig)->info, info);
...
add-to-queue();
...
}
...
}
When the message is delivered we'll have :
void clean_sig_hint(struct sigqueue *qsig) {
if (qsig->fsig != NULL) {
*(qsig->fsig) = NULL;
qsig->fsig = NULL;
}
}
When the file is closed :
void clean_fown_sighint(struct fown_struct *fown) {
if (fown->sig_hint != NULL) {
fown->sig_hint->fsig = NULL;
fown->sig_hint = NULL;
}
}
All these ops must be done under sigmask_lock lock ( send_signal() and signal
dequeue already does ).
This will make multiple signal from the same file to be stocked inside the same
slot reducing the RT signal traffic.
Comments ?
- Davide
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/