Re: svn commit: r198306 - head/sys/net

From: b. f. <bf1783_at_googlemail.com>
Date: Tue, 20 Oct 2009 23:21:51 +0000
>Author: qingli
>Date: Tue Oct 20 21:27:03 2009
>New Revision: 198306
>URL: http://svn.freebsd.org/changeset/base/198306

>Log:
>  The flow-table function flowtable_route_flush() may be called
>  during system initialization time. Since the flow-table is
>  designed to maintain per CPU flow cache, the existing code
>  did not check whether "smp_started" is true before calling
>  sched_bind() and sched_unbind(), which triggers a page fault.

>  Reviewed by:  jeff
>  MFC after:    immediately

>Modified:
>  head/sys/net/flowtable.c

...

>-
>-                       thread_lock(curthread);
>-                       sched_bind(curthread, i);
>-                       thread_unlock(curthread);
>+
>+                       if (smp_started == 1) {
>+                               thread_lock(curthread);
>+                               sched_bind(curthread, i);
>+                               thread_unlock(curthread);
>+                       }

...

Are these changes going to do the right thing on non-SMP kernels?


Regards,
                  b.
Received on Tue Oct 20 2009 - 21:21:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:57 UTC