Re: svn commit: r333745 - in head/sys/contrib/ck: include src

2018-05-17 Thread Pedro Giffuni



On 17/05/2018 14:35, Matthew Macy wrote:

On Thu, May 17, 2018 at 12:32 PM, Pedro Giffuni  wrote:


On 17/05/2018 14:27, Emmanuel Vadot wrote:

On Thu, 17 May 2018 14:20:05 -0500
Pedro Giffuni  wrote:


On 17/05/2018 14:12, Matthew Macy wrote:

How do I avoid problems while allowing timely updates?

-M

On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot 
wrote:

Hi Matt,

On Thu, 17 May 2018 18:14:10 + (UTC)
Matt Macy  wrote:


Author: mmacy
Date: Thu May 17 18:14:10 2018
New Revision: 333745
URL: https://svnweb.freebsd.org/changeset/base/333745

Log:
 ck: add support for executing callbacks outside of main poll loop

 Pull in change from upstream
deca119d14bfffd440770eb67cbdbeaf7b57eb7b

 |ck_epoch: introduce ck_epoch_deferred
 |
 |Allow for deferral to occur outside epoch poll critical loop
(which may access per-CPU structures).
 |

 Approved by:sbruno

Modified:
 head/sys/contrib/ck/include/ck_epoch.h
 head/sys/contrib/ck/src/ck_epoch.c


CK was imported in vendor-sys/ck, commiting directly into head will
cause some problems in the future.

Actually ... committing to head is fine: some things just have to be
fixed.

   This is not true, it can cause a lot of problems with futures updates
if the change isn't in the vendor repo.

OK ... I meant generally you can. The catch here is that the change was
already upstream so it should have been done in the vendor area and then
merged. It's best to fix this properly now.

Sorry for misguiding.


I'm happy to comply - just point me at the fine manual.



https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/subversion-primer.html
Section 5.4.4 (Vendor patches).

Cheers,

Pedro.

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r333745 - in head/sys/contrib/ck: include src

2018-05-17 Thread Matthew Macy
On Thu, May 17, 2018 at 12:32 PM, Pedro Giffuni  wrote:
>
>
> On 17/05/2018 14:27, Emmanuel Vadot wrote:
>>
>> On Thu, 17 May 2018 14:20:05 -0500
>> Pedro Giffuni  wrote:
>>
>>> On 17/05/2018 14:12, Matthew Macy wrote:

 How do I avoid problems while allowing timely updates?

 -M

 On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot 
 wrote:
>
>Hi Matt,
>
> On Thu, 17 May 2018 18:14:10 + (UTC)
> Matt Macy  wrote:
>
>> Author: mmacy
>> Date: Thu May 17 18:14:10 2018
>> New Revision: 333745
>> URL: https://svnweb.freebsd.org/changeset/base/333745
>>
>> Log:
>> ck: add support for executing callbacks outside of main poll loop
>>
>> Pull in change from upstream
>> deca119d14bfffd440770eb67cbdbeaf7b57eb7b
>>
>> |ck_epoch: introduce ck_epoch_deferred
>> |
>> |Allow for deferral to occur outside epoch poll critical loop
>> (which may access per-CPU structures).
>> |
>>
>> Approved by:sbruno
>>
>> Modified:
>> head/sys/contrib/ck/include/ck_epoch.h
>> head/sys/contrib/ck/src/ck_epoch.c
>>
>CK was imported in vendor-sys/ck, commiting directly into head will
> cause some problems in the future.
>>>
>>> Actually ... committing to head is fine: some things just have to be
>>> fixed.
>>
>>   This is not true, it can cause a lot of problems with futures updates
>> if the change isn't in the vendor repo.
>
> OK ... I meant generally you can. The catch here is that the change was
> already upstream so it should have been done in the vendor area and then
> merged. It's best to fix this properly now.
>
> Sorry for misguiding.
>

I'm happy to comply - just point me at the fine manual.


-M
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r333745 - in head/sys/contrib/ck: include src

2018-05-17 Thread Pedro Giffuni



On 17/05/2018 14:27, Emmanuel Vadot wrote:

On Thu, 17 May 2018 14:20:05 -0500
Pedro Giffuni  wrote:


On 17/05/2018 14:12, Matthew Macy wrote:

How do I avoid problems while allowing timely updates?

-M

On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot  wrote:

   Hi Matt,

On Thu, 17 May 2018 18:14:10 + (UTC)
Matt Macy  wrote:


Author: mmacy
Date: Thu May 17 18:14:10 2018
New Revision: 333745
URL: https://svnweb.freebsd.org/changeset/base/333745

Log:
ck: add support for executing callbacks outside of main poll loop

Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b

|ck_epoch: introduce ck_epoch_deferred
|
|Allow for deferral to occur outside epoch poll critical loop (which 
may access per-CPU structures).
|

Approved by:sbruno

Modified:
head/sys/contrib/ck/include/ck_epoch.h
head/sys/contrib/ck/src/ck_epoch.c


   CK was imported in vendor-sys/ck, commiting directly into head will
cause some problems in the future.

Actually ... committing to head is fine: some things just have to be fixed.

  This is not true, it can cause a lot of problems with futures updates
if the change isn't in the vendor repo.
OK ... I meant generally you can. The catch here is that the change was 
already upstream so it should have been done in the vendor area and then 
merged. It's best to fix this properly now.


Sorry for misguiding.

Pedro.


We do ask you try to upstream the change and re-merge things when possible.

  This is already upstream, Matt is just updating CK with a patch he did
( see
https://github.com/concurrencykit/ck/commit/deca119d14bfffd440770eb67cbdbeaf7b57eb7b)


Pedro.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r333745 - in head/sys/contrib/ck: include src

2018-05-17 Thread Emmanuel Vadot
On Thu, 17 May 2018 14:20:05 -0500
Pedro Giffuni  wrote:

> 
> On 17/05/2018 14:12, Matthew Macy wrote:
> > How do I avoid problems while allowing timely updates?
> >
> > -M
> >
> > On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot  
> > wrote:
> >>   Hi Matt,
> >>
> >> On Thu, 17 May 2018 18:14:10 + (UTC)
> >> Matt Macy  wrote:
> >>
> >>> Author: mmacy
> >>> Date: Thu May 17 18:14:10 2018
> >>> New Revision: 333745
> >>> URL: https://svnweb.freebsd.org/changeset/base/333745
> >>>
> >>> Log:
> >>>ck: add support for executing callbacks outside of main poll loop
> >>>
> >>>Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b
> >>>
> >>>|ck_epoch: introduce ck_epoch_deferred
> >>>|
> >>>|Allow for deferral to occur outside epoch poll critical loop 
> >>> (which may access per-CPU structures).
> >>>|
> >>>
> >>>Approved by:sbruno
> >>>
> >>> Modified:
> >>>head/sys/contrib/ck/include/ck_epoch.h
> >>>head/sys/contrib/ck/src/ck_epoch.c
> >>>
> >>   CK was imported in vendor-sys/ck, commiting directly into head will
> >> cause some problems in the future.
> 
> Actually ... committing to head is fine: some things just have to be fixed.

 This is not true, it can cause a lot of problems with futures updates
if the change isn't in the vendor repo.

> We do ask you try to upstream the change and re-merge things when possible.

 This is already upstream, Matt is just updating CK with a patch he did
( see
https://github.com/concurrencykit/ck/commit/deca119d14bfffd440770eb67cbdbeaf7b57eb7b)

> Pedro.

-- 
Emmanuel Vadot  
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r333745 - in head/sys/contrib/ck: include src

2018-05-17 Thread Pedro Giffuni


On 17/05/2018 14:12, Matthew Macy wrote:

How do I avoid problems while allowing timely updates?

-M

On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot  wrote:

  Hi Matt,

On Thu, 17 May 2018 18:14:10 + (UTC)
Matt Macy  wrote:


Author: mmacy
Date: Thu May 17 18:14:10 2018
New Revision: 333745
URL: https://svnweb.freebsd.org/changeset/base/333745

Log:
   ck: add support for executing callbacks outside of main poll loop

   Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b

   |ck_epoch: introduce ck_epoch_deferred
   |
   |Allow for deferral to occur outside epoch poll critical loop (which may 
access per-CPU structures).
   |

   Approved by:sbruno

Modified:
   head/sys/contrib/ck/include/ck_epoch.h
   head/sys/contrib/ck/src/ck_epoch.c


  CK was imported in vendor-sys/ck, commiting directly into head will
cause some problems in the future.


Actually ... committing to head is fine: some things just have to be fixed.
We do ask you try to upstream the change and re-merge things when possible.

Pedro.

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r333745 - in head/sys/contrib/ck: include src

2018-05-17 Thread Matthew Macy
How do I avoid problems while allowing timely updates?

-M

On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot  wrote:
>
>  Hi Matt,
>
> On Thu, 17 May 2018 18:14:10 + (UTC)
> Matt Macy  wrote:
>
>> Author: mmacy
>> Date: Thu May 17 18:14:10 2018
>> New Revision: 333745
>> URL: https://svnweb.freebsd.org/changeset/base/333745
>>
>> Log:
>>   ck: add support for executing callbacks outside of main poll loop
>>
>>   Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b
>>
>>   |ck_epoch: introduce ck_epoch_deferred
>>   |
>>   |Allow for deferral to occur outside epoch poll critical loop (which 
>> may access per-CPU structures).
>>   |
>>
>>   Approved by:sbruno
>>
>> Modified:
>>   head/sys/contrib/ck/include/ck_epoch.h
>>   head/sys/contrib/ck/src/ck_epoch.c
>>
>
>  CK was imported in vendor-sys/ck, commiting directly into head will
> cause some problems in the future.
>
> --
> Emmanuel Vadot  
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r333745 - in head/sys/contrib/ck: include src

2018-05-17 Thread Emmanuel Vadot

 Hi Matt,

On Thu, 17 May 2018 18:14:10 + (UTC)
Matt Macy  wrote:

> Author: mmacy
> Date: Thu May 17 18:14:10 2018
> New Revision: 333745
> URL: https://svnweb.freebsd.org/changeset/base/333745
> 
> Log:
>   ck: add support for executing callbacks outside of main poll loop
>   
>   Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b
>   
>   |ck_epoch: introduce ck_epoch_deferred
>   |
>   |Allow for deferral to occur outside epoch poll critical loop (which 
> may access per-CPU structures).
>   |
>   
>   Approved by:sbruno
> 
> Modified:
>   head/sys/contrib/ck/include/ck_epoch.h
>   head/sys/contrib/ck/src/ck_epoch.c
> 

 CK was imported in vendor-sys/ck, commiting directly into head will
cause some problems in the future.

-- 
Emmanuel Vadot  
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r333745 - in head/sys/contrib/ck: include src

2018-05-17 Thread Matt Macy
Author: mmacy
Date: Thu May 17 18:14:10 2018
New Revision: 333745
URL: https://svnweb.freebsd.org/changeset/base/333745

Log:
  ck: add support for executing callbacks outside of main poll loop
  
  Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b
  
  |ck_epoch: introduce ck_epoch_deferred
  |
  |Allow for deferral to occur outside epoch poll critical loop (which may 
access per-CPU structures).
  |
  
  Approved by:  sbruno

Modified:
  head/sys/contrib/ck/include/ck_epoch.h
  head/sys/contrib/ck/src/ck_epoch.c

Modified: head/sys/contrib/ck/include/ck_epoch.h
==
--- head/sys/contrib/ck/include/ck_epoch.h  Thu May 17 17:59:35 2018
(r333744)
+++ head/sys/contrib/ck/include/ck_epoch.h  Thu May 17 18:14:10 2018
(r333745)
@@ -266,6 +266,7 @@ void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t
 void ck_epoch_unregister(ck_epoch_record_t *);
 
 bool ck_epoch_poll(ck_epoch_record_t *);
+bool ck_epoch_poll_deferred(struct ck_epoch_record *record, ck_stack_t 
*deferred);
 void ck_epoch_synchronize(ck_epoch_record_t *);
 void ck_epoch_synchronize_wait(ck_epoch_t *, ck_epoch_wait_cb_t *, void *);
 void ck_epoch_barrier(ck_epoch_record_t *);

Modified: head/sys/contrib/ck/src/ck_epoch.c
==
--- head/sys/contrib/ck/src/ck_epoch.c  Thu May 17 17:59:35 2018
(r333744)
+++ head/sys/contrib/ck/src/ck_epoch.c  Thu May 17 18:14:10 2018
(r333745)
@@ -349,7 +349,7 @@ ck_epoch_scan(struct ck_epoch *global,
 }
 
 static void
-ck_epoch_dispatch(struct ck_epoch_record *record, unsigned int e)
+ck_epoch_dispatch(struct ck_epoch_record *record, unsigned int e, ck_stack_t 
*deferred)
 {
unsigned int epoch = e & (CK_EPOCH_LENGTH - 1);
ck_stack_entry_t *head, *next, *cursor;
@@ -362,7 +362,10 @@ ck_epoch_dispatch(struct ck_epoch_record *record, unsi
ck_epoch_entry_container(cursor);
 
next = CK_STACK_NEXT(cursor);
-   entry->function(entry);
+   if (deferred != NULL)
+   ck_stack_push_spnc(deferred, &entry->stack_entry);
+   else
+   entry->function(entry);
i++;
}
 
@@ -390,7 +393,7 @@ ck_epoch_reclaim(struct ck_epoch_record *record)
unsigned int epoch;
 
for (epoch = 0; epoch < CK_EPOCH_LENGTH; epoch++)
-   ck_epoch_dispatch(record, epoch);
+   ck_epoch_dispatch(record, epoch, NULL);
 
return;
 }
@@ -551,7 +554,7 @@ ck_epoch_barrier_wait(struct ck_epoch_record *record, 
  * is far from ideal too.
  */
 bool
-ck_epoch_poll(struct ck_epoch_record *record)
+ck_epoch_poll_deferred(struct ck_epoch_record *record, ck_stack_t *deferred)
 {
bool active;
unsigned int epoch;
@@ -572,7 +575,7 @@ ck_epoch_poll(struct ck_epoch_record *record)
if (active == false) {
record->epoch = epoch;
for (epoch = 0; epoch < CK_EPOCH_LENGTH; epoch++)
-   ck_epoch_dispatch(record, epoch);
+   ck_epoch_dispatch(record, epoch, deferred);
 
return true;
}
@@ -580,6 +583,13 @@ ck_epoch_poll(struct ck_epoch_record *record)
/* If an active thread exists, rely on epoch observation. */
(void)ck_pr_cas_uint(&global->epoch, epoch, epoch + 1);
 
-   ck_epoch_dispatch(record, epoch + 1);
+   ck_epoch_dispatch(record, epoch + 1, deferred);
return true;
+}
+
+bool
+ck_epoch_poll(struct ck_epoch_record *record)
+{
+
+   return ck_epoch_poll_deferred(record, NULL);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"