Re: [PATCH] async poll for 2.5

John Gardiner Myers (jgmyers@netscape.com)
Tue, 15 Oct 2002 16:26:59 -0700


This is a cryptographically signed message in MIME format.

--------------ms040306030002020302010406
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Benjamin LaHaise wrote:

>I suppose one way of getting the async poll code up to snuff would be to
>cache the poll registration in the file descriptor. Alternatively, the
>iocb could simply persist until it is cancelled or a refire is permitted
>(so that the event queue does not get overrun).
>
First, can you confirm that your only problem with the async poll code
is the fact that it doesn't amortize the registration/deregistration
cost across multiple events?

I would say that the fact that the async poll code doesn't do this
amortization is not sufficient reason to hold up the patch. A
non-amortizing async poll is sufficiently useful to warrant inclusion.
It is conceivable that some applications will not want to amortize some
of their poll requests. The non-amortizing interface can later be
extended to an amortizing one by defining an "amortize me" bit to the
events request mask.

I don't think caching the registration in the file descriptor is a good
idea--there can be multiple registrations against a given fd. The
registration should be cached close to the iocb--either in the iocb or
in some structure that directly references the iocb.

The model for multiple-events-per-iocb I was thinking of is as follows:

Add a concept of a "partial completion". Unlike a normal completion,
when a partial completion event fires the iocb is not freed. Instead
the iocb goes into a "fired" state.

When an iocb is in the fired state, it will not generate any more
completion events until it is "rearmed" by user space. The method by
which user space rearms an iocb is to be determined. Upon rearming, the
iocb is once again able to generate either a partial or normal
completion. As with submission, rearming can generate this completion
immediately if the situation warrants.

Canceling an iocb in the rearmed state is the same as canceling an iocb
that has never generated a completion event. Canceling an iocb in the
fired state returns a normal completion through the cancellation
interface and returns a distinct error code (not 0 or -EAGAIN) to inform
the caller that there is an outstanding event to be synchronized with.

Attempting to rearm a canceled iocb returns an error, probably -EAGAIN
to be consistent with cancellation.

--------------ms040306030002020302010406
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSI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DAgcwDQYIKoZIhvcNAwICASgwga0GCyqGSIb3DQEJEAILMYGdoIGaMIGTMQswCQYD
VQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxGzAZBgNVBAoT
EkFtZXJpY2EgT25saW5lIEluYzEZMBcGA1UECxMQQU9MIFRlY2hub2xvZ2llczEnMCUGA1UE
AxMeSW50cmFuZXQgQ2VydGlmaWNhdGUgQXV0aG9yaXR5AgJb3zANBgkqhkiG9w0BAQEFAASB
gB2p/A5wBeasOohNyBQEhkRzOPec39EcpfrcM9CBQ7JZK041IIcFbAsdssbWqOZmDz00vSkt
bH+n01q2GpFam8XG0mEF0fdd90lLA09CixuAo45pYWgclb6tFmcEerrt0HNf9RPqknjR2qvt
8zZJ/4X03ppQFeU7Qy2pLhvYv9NVAAAAAAAA
--------------ms040306030002020302010406--

-
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/