Re: [PATCH RESEND 1/2] net: enable high resolution timer mode to timeout datagram sockets

2017-08-22 Thread Vallish Vaidyeshwara
On Mon, Aug 21, 2017 at 01:10:34PM -0700, Cong Wang wrote: > On Fri, Aug 18, 2017 at 11:44 AM, Vallish Vaidyeshwara > wrote: > > - *timeo_p = schedule_timeout(*timeo_p); > > + /* Wait using highres timer */ > > + expires = ktime_add_ns(ktime_get(),

Re: [PATCH RESEND 1/2] net: enable high resolution timer mode to timeout datagram sockets

2017-08-22 Thread Vallish Vaidyeshwara
On Mon, Aug 21, 2017 at 01:10:34PM -0700, Cong Wang wrote: > On Fri, Aug 18, 2017 at 11:44 AM, Vallish Vaidyeshwara > wrote: > > - *timeo_p = schedule_timeout(*timeo_p); > > + /* Wait using highres timer */ > > + expires = ktime_add_ns(ktime_get(), jiffies_to_nsecs(*timeo_p)); >

Re: [PATCH RESEND 1/2] net: enable high resolution timer mode to timeout datagram sockets

2017-08-21 Thread Cong Wang
On Fri, Aug 18, 2017 at 11:44 AM, Vallish Vaidyeshwara wrote: > - *timeo_p = schedule_timeout(*timeo_p); > + /* Wait using highres timer */ > + expires = ktime_add_ns(ktime_get(), jiffies_to_nsecs(*timeo_p)); > + pre_sched_time = jiffies; > + if

Re: [PATCH RESEND 1/2] net: enable high resolution timer mode to timeout datagram sockets

2017-08-21 Thread Cong Wang
On Fri, Aug 18, 2017 at 11:44 AM, Vallish Vaidyeshwara wrote: > - *timeo_p = schedule_timeout(*timeo_p); > + /* Wait using highres timer */ > + expires = ktime_add_ns(ktime_get(), jiffies_to_nsecs(*timeo_p)); > + pre_sched_time = jiffies; > + if (schedule_hrtimeout(,

[PATCH RESEND 1/2] net: enable high resolution timer mode to timeout datagram sockets

2017-08-18 Thread Vallish Vaidyeshwara
Enable high resolution timer mode to time SO_RCVTIMEO value used with setsockopt(2) on AF_UNIX and AF_INET datagram sockets. By default, SO_RCVTIMEO uses low resolution timer which is good for most of socket use cases. Background: Kernel timer wheel was refactored in 4.8 to avoid drawbacks with

[PATCH RESEND 1/2] net: enable high resolution timer mode to timeout datagram sockets

2017-08-18 Thread Vallish Vaidyeshwara
Enable high resolution timer mode to time SO_RCVTIMEO value used with setsockopt(2) on AF_UNIX and AF_INET datagram sockets. By default, SO_RCVTIMEO uses low resolution timer which is good for most of socket use cases. Background: Kernel timer wheel was refactored in 4.8 to avoid drawbacks with