Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2011 18:05:13 +0100
From:      Attilio Rao <attilio@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        Kostik Belousov <kostikbel@gmail.com>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r228433 - in head/sys: kern security/mac
Message-ID:  <CAJ-FndBSBuoR4=cdjs0QgN4SAR-uJ39Kpw4EV_yjU97c=uyU0w@mail.gmail.com>
In-Reply-To: <CAJ-FndDJbrTT0u1Hz_0MLJiEq3G0qcq77jBqfttVeUgiR414=g@mail.gmail.com>
References:  <201112121005.pBCA5Dar093711@svn.freebsd.org> <20111212101558.GK50300@deviant.kiev.zoral.com.ua> <4EE5D574.9080303@FreeBSD.org> <CAJ-FndDJbrTT0u1Hz_0MLJiEq3G0qcq77jBqfttVeUgiR414=g@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

2011/12/12 Attilio Rao <attilio@freebsd.org>:
> 2011/12/12 Andriy Gapon <avg@freebsd.org>:
>> on 12/12/2011 12:15 Kostik Belousov said the following:
>>> On Mon, Dec 12, 2011 at 10:05:13AM +0000, Andriy Gapon wrote:
>>>> Author: avg
>>>> Date: Mon Dec 12 10:05:13 2011
>>>> New Revision: 228433
>>>> URL: http://svn.freebsd.org/changeset/base/228433
>>>>
>>>> Log:
>>>>   put sys/systm.h at its proper place or add it if missing
>>>>
>>>>   Reported by:       lstewart, tinderbox
>>>>   Pointyhat to:      avg, attilio
>>>>   MFC after: 1 week
>>>>   MFC with:  r228430
>>>>
>>>> Modified:
>>>>   head/sys/kern/kern_sx.c
>>>>   head/sys/kern/vfs_cache.c
>>>>   head/sys/security/mac/mac_framework.c
>>>>   head/sys/security/mac/mac_priv.c
>>> It means that previously sx.h did not required systm.h and now it does ?
>>> Might be, you should move SCHEDULER_STOPPED and stop_scheduler declarations
>>> into sys/lock.h ?
>>>
>>
>> Strictly speaking it's sys/lockstat.h that now requires systm.h.
>> I am not an expert in FreeBSD header file organization, so I will just follow
>> whatever the experts advise.
>
> I think that we should revert this part of the patch and just fix
> dtrace_probe() for pollution, this way we get the same effect and
> avoid namespace pollution (and still improve the MFC situation).
>
> I'll make a patch available in the next hour.

More precisely, what do you think about the patch below?
I just didn't revert the moving of systm.h under param.h because Bruce
seems to prefer that.

I'm starting test-compile right now, let me know your preference.

Attilio

Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
(revision 228438)
+++ sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c     (working copy)
@@ -5877,6 +5877,9 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintp
        volatile uint16_t *flags;
        hrtime_t now;

+       if (SCHEDULER_STOPPED())
+               return;
+
 #if defined(sun)
        /*
         * Kick out immediately if this CPU is still being born (in which case
Index: sys/security/mac/mac_priv.c
===================================================================
--- sys/security/mac/mac_priv.c (revision 228438)
+++ sys/security/mac/mac_priv.c (working copy)
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
 #include "opt_mac.h"

 #include <sys/param.h>
-#include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/priv.h>
 #include <sys/sdt.h>
Index: sys/sys/lockstat.h
===================================================================
--- sys/sys/lockstat.h  (revision 228438)
+++ sys/sys/lockstat.h  (working copy)
@@ -185,24 +185,17 @@ extern uint64_t lockstat_nsecs(void);
 #define        LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt,
f, l)  do {   \
        uint32_t id;                                                         \
                                                                             \
-       if (!SCHEDULER_STOPPED()) {                                          \
-               lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt,  \
-                   f, l);                                                   \
-               if ((id = lockstat_probemap[(probe)]))                       \
-                       (*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0,    \
-                           0, 0);                                           \
-       }                                                                    \
+       lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l);   \
+       if ((id = lockstat_probemap[(probe)]))                               \
+               (*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0);     \
 } while (0)

 #define        LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp)  do {
              \
        uint32_t id;                                                         \
                                                                             \
-       if (!SCHEDULER_STOPPED()) {                                          \
-               lock_profile_release_lock(&(lp)->lock_object);               \
-               if ((id = lockstat_probemap[(probe)]))                       \
-                       (*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0,    \
-                           0, 0);                                           \
-       }                                                                    \
+       lock_profile_release_lock(&(lp)->lock_object);                       \
+       if ((id = lockstat_probemap[(probe)]))                               \
+               (*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0);     \
 } while (0)

 #else  /* !KDTRACE_HOOKS */


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-FndBSBuoR4=cdjs0QgN4SAR-uJ39Kpw4EV_yjU97c=uyU0w>