* [LTP] [POSIX][PATCH]A awaited IO request completion signal can case lio_listio return EINTR.
@ 2010-10-29 1:11 Bian Naimeng
2010-11-08 7:11 ` Bian Naimeng
0 siblings, 1 reply; 4+ messages in thread
From: Bian Naimeng @ 2010-10-29 1:11 UTC (permalink / raw)
To: yanegomi; +Cc: ltp-list
Open posix documents point lio_listio may return EINTR caused by a awaited I/O requst
completion signal.
[EINTR]
A signal was delivered while waiting for all I/O requests to complete during an
LIO_WAIT operation. Note that, since each I/O operation invoked by lio_listio()
may possibly provoke a signal when it completes, this error return may be caused
by the completion of one (or more) of the very I/O operations being awaited.
Outstanding I/O requests are not canceled, and the application shall examine each
list element to determine whether the request was initiated, canceled, or completed.
So it's unnecessary to setup handler for IO operation completion, we just need check
the aio_error and aio_return for each request, it has same effect on checking
received_selected.
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
---
.../conformance/interfaces/lio_listio/1-1.c | 35 ++------------------
1 files changed, 3 insertions(+), 32 deletions(-)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c
index f19fcd3..5e4d16a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c
@@ -38,18 +38,11 @@
#define NUM_AIOCBS 10
#define BUF_SIZE 1024*1024
-int received_selected = 0;
int received_all = 0;
void
sigrt1_handler(int signum, siginfo_t *info, void *context)
{
- received_selected = info->si_value.sival_int;
-}
-
-void
-sigrt2_handler(int signum, siginfo_t *info, void *context)
-{
received_all = 1;
}
@@ -105,30 +98,19 @@ int main()
aiocbs[i]->aio_buf = &bufs[i*BUF_SIZE];
aiocbs[i]->aio_nbytes = BUF_SIZE;
aiocbs[i]->aio_lio_opcode = LIO_WRITE;
-
- /* Use SIRTMIN+1 for individual completions */
- aiocbs[i]->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
- aiocbs[i]->aio_sigevent.sigev_signo = SIGRTMIN+1;
- aiocbs[i]->aio_sigevent.sigev_value.sival_int = i;
}
- /* Use SIGRTMIN+2 for list completion */
+ /* Use SIGRTMIN+1 for list completion */
event.sigev_notify = SIGEV_SIGNAL;
- event.sigev_signo = SIGRTMIN+2;
+ event.sigev_signo = SIGRTMIN+1;
event.sigev_value.sival_ptr = NULL;
- /* Setup handler for individual operation completion */
+ /* Setup handler for list completion */
action.sa_sigaction = sigrt1_handler;
sigemptyset(&action.sa_mask);
action.sa_flags = SA_SIGINFO|SA_RESTART;
sigaction(SIGRTMIN+1, &action, NULL);
- /* Setup handler for list completion */
- action.sa_sigaction = sigrt2_handler;
- sigemptyset(&action.sa_mask);
- action.sa_flags = SA_SIGINFO|SA_RESTART;
- sigaction(SIGRTMIN+2, &action, NULL);
-
/* Submit request list */
ret = lio_listio(LIO_WAIT, aiocbs, NUM_AIOCBS, &event);
@@ -142,17 +124,6 @@ int main()
exit (PTS_FAIL);
}
- if (received_selected != NUM_AIOCBS-1)
- {
- printf(TNAME " lio_listio() did not wait\n");
- for (i=0; i<NUM_AIOCBS; i++)
- free (aiocbs[i]);
- free (bufs);
- free (aiocbs);
- close (fd);
- exit (PTS_FAIL);
- }
-
if (received_all != 0)
{
printf(TNAME " lio_listio() did not ignore the sig argument\n");
--
1.7.0.4
--
Regards
Bian Naimeng
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [POSIX][PATCH]A awaited IO request completion signal can case lio_listio return EINTR.
2010-10-29 1:11 [LTP] [POSIX][PATCH]A awaited IO request completion signal can case lio_listio return EINTR Bian Naimeng
@ 2010-11-08 7:11 ` Bian Naimeng
2010-11-08 21:49 ` Garrett Cooper
0 siblings, 1 reply; 4+ messages in thread
From: Bian Naimeng @ 2010-11-08 7:11 UTC (permalink / raw)
To: yanegomi; +Cc: ltp-list
Bian Naimeng wrote:
> Open posix documents point lio_listio may return EINTR caused by a awaited I/O requst
> completion signal.
>
> [EINTR]
> A signal was delivered while waiting for all I/O requests to complete during an
> LIO_WAIT operation. Note that, since each I/O operation invoked by lio_listio()
> may possibly provoke a signal when it completes, this error return may be caused
> by the completion of one (or more) of the very I/O operations being awaited.
> Outstanding I/O requests are not canceled, and the application shall examine each
> list element to determine whether the request was initiated, canceled, or completed.
>
> So it's unnecessary to setup handler for IO operation completion, we just need check
> the aio_error and aio_return for each request, it has same effect on checking
> received_selected.
>
> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>
Hi Garrett,
Would you like to pick up this patch? Any reply is helpful to me, so please let me
know what's your opinion if you are free. ^_^
Best Regards
Bian
> ---
> .../conformance/interfaces/lio_listio/1-1.c | 35 ++------------------
> 1 files changed, 3 insertions(+), 32 deletions(-)
>
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c
> index f19fcd3..5e4d16a 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c
> @@ -38,18 +38,11 @@
> #define NUM_AIOCBS 10
> #define BUF_SIZE 1024*1024
>
> -int received_selected = 0;
> int received_all = 0;
>
> void
> sigrt1_handler(int signum, siginfo_t *info, void *context)
> {
> - received_selected = info->si_value.sival_int;
> -}
> -
> -void
> -sigrt2_handler(int signum, siginfo_t *info, void *context)
> -{
> received_all = 1;
> }
>
> @@ -105,30 +98,19 @@ int main()
> aiocbs[i]->aio_buf = &bufs[i*BUF_SIZE];
> aiocbs[i]->aio_nbytes = BUF_SIZE;
> aiocbs[i]->aio_lio_opcode = LIO_WRITE;
> -
> - /* Use SIRTMIN+1 for individual completions */
> - aiocbs[i]->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
> - aiocbs[i]->aio_sigevent.sigev_signo = SIGRTMIN+1;
> - aiocbs[i]->aio_sigevent.sigev_value.sival_int = i;
> }
>
> - /* Use SIGRTMIN+2 for list completion */
> + /* Use SIGRTMIN+1 for list completion */
> event.sigev_notify = SIGEV_SIGNAL;
> - event.sigev_signo = SIGRTMIN+2;
> + event.sigev_signo = SIGRTMIN+1;
> event.sigev_value.sival_ptr = NULL;
>
> - /* Setup handler for individual operation completion */
> + /* Setup handler for list completion */
> action.sa_sigaction = sigrt1_handler;
> sigemptyset(&action.sa_mask);
> action.sa_flags = SA_SIGINFO|SA_RESTART;
> sigaction(SIGRTMIN+1, &action, NULL);
>
> - /* Setup handler for list completion */
> - action.sa_sigaction = sigrt2_handler;
> - sigemptyset(&action.sa_mask);
> - action.sa_flags = SA_SIGINFO|SA_RESTART;
> - sigaction(SIGRTMIN+2, &action, NULL);
> -
> /* Submit request list */
> ret = lio_listio(LIO_WAIT, aiocbs, NUM_AIOCBS, &event);
>
> @@ -142,17 +124,6 @@ int main()
> exit (PTS_FAIL);
> }
>
> - if (received_selected != NUM_AIOCBS-1)
> - {
> - printf(TNAME " lio_listio() did not wait\n");
> - for (i=0; i<NUM_AIOCBS; i++)
> - free (aiocbs[i]);
> - free (bufs);
> - free (aiocbs);
> - close (fd);
> - exit (PTS_FAIL);
> - }
> -
> if (received_all != 0)
> {
> printf(TNAME " lio_listio() did not ignore the sig argument\n");
--
Regards
Bian Naimeng
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [POSIX][PATCH]A awaited IO request completion signal can case lio_listio return EINTR.
2010-11-08 7:11 ` Bian Naimeng
@ 2010-11-08 21:49 ` Garrett Cooper
2010-12-26 13:34 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Garrett Cooper @ 2010-11-08 21:49 UTC (permalink / raw)
To: Bian Naimeng; +Cc: ltp-list
On Sun, Nov 7, 2010 at 11:11 PM, Bian Naimeng <biannm@cn.fujitsu.com> wrote:
> Bian Naimeng wrote:
>> Open posix documents point lio_listio may return EINTR caused by a awaited I/O requst
>> completion signal.
>>
>> [EINTR]
>> A signal was delivered while waiting for all I/O requests to complete during an
>> LIO_WAIT operation. Note that, since each I/O operation invoked by lio_listio()
>> may possibly provoke a signal when it completes, this error return may be caused
>> by the completion of one (or more) of the very I/O operations being awaited.
>> Outstanding I/O requests are not canceled, and the application shall examine each
>> list element to determine whether the request was initiated, canceled, or completed.
>>
>> So it's unnecessary to setup handler for IO operation completion, we just need check
>> the aio_error and aio_return for each request, it has same effect on checking
>> received_selected.
>>
>> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>>
>
> Hi Garrett,
>
> Would you like to pick up this patch? Any reply is helpful to me, so please let me
> know what's your opinion if you are free. ^_^
I have some potential concerns with the above patch. Let me fully
digest it and I'll get back to you.
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [POSIX][PATCH]A awaited IO request completion signal can case lio_listio return EINTR.
2010-11-08 21:49 ` Garrett Cooper
@ 2010-12-26 13:34 ` Cyril Hrubis
0 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2010-12-26 13:34 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list
Hi!
> >> Open posix documents point lio_listio may return EINTR caused by a awaited I/O requst
> >> completion signal.
> >>
> >> [EINTR]
> >> A signal was delivered while waiting for all I/O requests to complete during an
> >> LIO_WAIT operation. Note that, since each I/O operation invoked by lio_listio()
> >> may possibly provoke a signal when it completes, this error return may be caused
> >> by the completion of one (or more) of the very I/O operations being awaited.
> >> Outstanding I/O requests are not canceled, and the application shall examine each
> >> list element to determine whether the request was initiated, canceled, or completed.
> >>
> >> So it's unnecessary to setup handler for IO operation completion, we just need check
> >> the aio_error and aio_return for each request, it has same effect on checking
> >> received_selected.
> >>
> >> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
> >>
> >
> > Hi Garrett,
> >
> > Would you like to pick up this patch? Any reply is helpful to me, so please let me
> > know what's your opinion if you are free. ^_^
>
> I have some potential concerns with the above patch. Let me fully
> digest it and I'll get back to you.
>
Ping. The patch seems to be reasonable.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-26 13:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-29 1:11 [LTP] [POSIX][PATCH]A awaited IO request completion signal can case lio_listio return EINTR Bian Naimeng
2010-11-08 7:11 ` Bian Naimeng
2010-11-08 21:49 ` Garrett Cooper
2010-12-26 13:34 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox