From owner-svn-src-user@FreeBSD.ORG Sun May 15 02:21:39 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF985106564A; Sun, 15 May 2011 02:21:39 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFF778FC0C; Sun, 15 May 2011 02:21:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F2LdBS023073; Sun, 15 May 2011 02:21:39 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F2LdnE023071; Sun, 15 May 2011 02:21:39 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201105150221.p4F2LdnE023071@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 15 May 2011 02:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221941 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 02:21:40 -0000 Author: gabor Date: Sun May 15 02:21:39 2011 New Revision: 221941 URL: http://svn.freebsd.org/changeset/base/221941 Log: - Also implement REG_STARTEND for wchar matching Modified: user/gabor/tre-integration/contrib/tre/lib/regexec.c Modified: user/gabor/tre-integration/contrib/tre/lib/regexec.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/regexec.c Sun May 15 02:09:12 2011 (r221940) +++ user/gabor/tre-integration/contrib/tre/lib/regexec.c Sun May 15 02:21:39 2011 (r221941) @@ -246,7 +246,29 @@ tre_regwnexec(const regex_t *preg, const size_t nmatch, regmatch_t pmatch[], int eflags) { tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; - return tre_match(tnfa, str, len, STR_WIDE, nmatch, pmatch, eflags); + + if (eflags & REG_STARTEND) + { + off_t s_off = pmatch[0].rm_so; + off_t e_off = pmatch[0].rm_eo; + size_t slen = e_off - s_off; + wchar_t *sstr = xmalloc(slen * sizeof(wint_t)); + wcsncpy(sstr, &str[s_off], slen); + int ret = tre_match(tnfa, sstr, slen, STR_WIDE, nmatch, pmatch, eflags); + if (!(eflags & REG_NOSUB)) + { + for (unsigned i = 0; i < nmatch; i++) + { + pmatch[i].rm_so += slen; + pmatch[i].rm_eo += slen; + } + } + return ret; + } + else + { + return tre_match(tnfa, str, len, STR_WIDE, nmatch, pmatch, eflags); + } } int From owner-svn-src-user@FreeBSD.ORG Sun May 15 09:59:29 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80FFC1065673; Sun, 15 May 2011 09:59:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57B2D8FC16; Sun, 15 May 2011 09:59:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F9xTwj032242; Sun, 15 May 2011 09:59:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F9xTqt032241; Sun, 15 May 2011 09:59:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105150959.p4F9xTqt032241@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 May 2011 09:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221950 - user/avg/xcpu/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 09:59:29 -0000 Author: avg Date: Sun May 15 09:59:29 2011 New Revision: 221950 URL: http://svn.freebsd.org/changeset/base/221950 Log: [fixup] generic_stop_cpus: release stopper_cpu Mismerged this between git and svn. Modified: user/avg/xcpu/sys/kern/subr_smp.c Modified: user/avg/xcpu/sys/kern/subr_smp.c ============================================================================== --- user/avg/xcpu/sys/kern/subr_smp.c Sun May 15 08:27:32 2011 (r221949) +++ user/avg/xcpu/sys/kern/subr_smp.c Sun May 15 09:59:29 2011 (r221950) @@ -270,6 +270,7 @@ generic_stop_cpus(cpumask_t map, u_int t } } + stopper_cpu = NOCPU; spinlock_exit(); return (1); } From owner-svn-src-user@FreeBSD.ORG Sun May 15 10:01:38 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCDCD106564A; Sun, 15 May 2011 10:01:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0F458FC12; Sun, 15 May 2011 10:01:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FA1cYZ032379; Sun, 15 May 2011 10:01:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FA1cas032377; Sun, 15 May 2011 10:01:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105151001.p4FA1cas032377@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 May 2011 10:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221951 - user/avg/xcpu/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 10:01:38 -0000 Author: avg Date: Sun May 15 10:01:38 2011 New Revision: 221951 URL: http://svn.freebsd.org/changeset/base/221951 Log: smp_rendezvous: correctly support concurrent complex rendezvous This is a big change. A problem with the previous approach can be demonstrated by this example: - processors Ps1 and Ps2 issue complex rendezvous requests R1 and R2 to processors Pt1 and Pt2 - because of request timings Pt1 gets R1 before R2 while Pt2 gets R2 before R1 - Pt1 executes setup action of R1 and waits for Pt2 to do the same - Pt2 executes setup action of R2 and waits for Pt1 to do the same - deadlock New approach is that we should check for incoming events while waiting in between of actions of a complex rendezvous event. In the example above this means that Pt1 after execution of action of R1 would then notice R2 and execute its setup action. Thus we allow actions of different requests to be interleaved. The only important limitation is that target CPUs should not leave rendezvous handling context until all of rendezvous' actions are executed. To implement this approach all rendezvous sequence points are coordinated via a rendezvous' master CPU. Slave CPUs just execute one action and go back to main event processing loop. The master CPU waits for all targeted slave CPUs to executed the current action (and while waiting it also checks for incoming events). When all the slave CPUs finish executing current action, then the master CPU signals them to execute the next action. Some implementation details: - master CPU increases work count for slave CPUs by total count of non-no-barrier actions in a rendezvous, so that the slave CPUs do not leave rendezvous handling context until all actions are done - master CPU processes incoming request in between posting its actions - master CPU bumps its work count before posting action, so that other CPUs know that the master CPU can process incoming events without being IPI-ed - master CPU processes all incoming events before leaving smp_rendezvous so that it fully completes incoming complex rendezvous without leaving the context Modified: user/avg/xcpu/sys/kern/subr_smp.c Modified: user/avg/xcpu/sys/kern/subr_smp.c ============================================================================== --- user/avg/xcpu/sys/kern/subr_smp.c Sun May 15 09:59:29 2011 (r221950) +++ user/avg/xcpu/sys/kern/subr_smp.c Sun May 15 10:01:38 2011 (r221951) @@ -114,15 +114,13 @@ SYSCTL_INT(_kern_smp, OID_AUTO, forward_ /* Variables needed for SMP rendezvous. */ struct smp_rendezvous_data { - void (*smp_rv_setup_func)(void *arg); void (*smp_rv_action_func)(void *arg); - void (*smp_rv_teardown_func)(void *arg); void *smp_rv_func_arg; - volatile int smp_rv_waiters[3]; + int smp_rv_waiters; int smp_rv_ncpus; }; -static DPCPU_DEFINE(struct smp_rendezvous_data, smp_rv_data); +volatile static DPCPU_DEFINE(struct smp_rendezvous_data, smp_rv_data); static volatile DPCPU_DEFINE(cpumask_t, smp_rv_senders); static volatile DPCPU_DEFINE(cpumask_t, smp_rv_count); @@ -412,100 +410,160 @@ static void smp_rendezvous_action_body(int cpu) { volatile struct smp_rendezvous_data *rv; - void *local_func_arg; - void (*local_setup_func)(void*); - void (*local_action_func)(void*); - void (*local_teardown_func)(void*); - int ncpus; + void *func_arg; + void (*action_func)(void*); rv = DPCPU_ID_PTR(cpu, smp_rv_data); - local_func_arg = rv->smp_rv_func_arg; - local_setup_func = rv->smp_rv_setup_func; - local_action_func = rv->smp_rv_action_func; - local_teardown_func = rv->smp_rv_teardown_func; - ncpus = rv->smp_rv_ncpus; + func_arg = rv->smp_rv_func_arg; + action_func = rv->smp_rv_action_func; - /* setup function */ - if (local_setup_func != smp_no_rendevous_barrier) { - if (local_setup_func != NULL) - local_setup_func(local_func_arg); - - /* spin on entry rendezvous */ - atomic_add_int(&rv->smp_rv_waiters[0], 1); - while (rv->smp_rv_waiters[0] < ncpus) - cpu_spinwait(); - } + if (action_func != NULL) + action_func(func_arg); - /* action function */ - if (local_action_func != NULL) - local_action_func(local_func_arg); - - if (local_teardown_func != smp_no_rendevous_barrier) { - /* spin on exit rendezvous */ - atomic_add_int(&rv->smp_rv_waiters[1], 1); - while (rv->smp_rv_waiters[1] < ncpus) - cpu_spinwait(); + atomic_add_int(&rv->smp_rv_waiters, 1); +} - atomic_add_int(&rv->smp_rv_waiters[2], 1); +static int +smp_rendezvous_action_pass(void) +{ + cpumask_t mask; + int count; + int cpu; - /* teardown function */ - if (local_teardown_func != NULL) - local_teardown_func(local_func_arg); - } else - atomic_add_int(&rv->smp_rv_waiters[2], 1); + count = 0; + mask = DPCPU_GET(smp_rv_senders); + if (mask == 0) + return (count); + + atomic_clear_acq_int(DPCPU_PTR(smp_rv_senders), mask); + do { + count++; + cpu = ffs(mask) - 1; + mask &= ~(1 << cpu); + smp_rendezvous_action_body(cpu); + } while (mask != 0); + + return (count); } void smp_rendezvous_action(void) { - cpumask_t mask; int pending; int count; - int cpu; pending = DPCPU_GET(smp_rv_count); while (pending != 0) { KASSERT(pending > 0, ("negative pending rendezvous count")); - mask = DPCPU_GET(smp_rv_senders); - if (mask == 0) { + count = smp_rendezvous_action_pass(); + if (count == 0) { cpu_spinwait(); continue; } - - atomic_clear_acq_int(DPCPU_PTR(smp_rv_senders), mask); - count = 0; - do { - count++; - cpu = ffs(mask) - 1; - mask &= ~(1 << cpu); - smp_rendezvous_action_body(cpu); - } while (mask != 0); - pending = atomic_fetchadd_int(DPCPU_PTR(smp_rv_count), -count); pending -= count; } } static void -smp_rendezvous_wait(void) +smp_rendezvous_wait(volatile struct smp_rendezvous_data *rv) { - volatile struct smp_rendezvous_data *rv; int ncpus; + int count; - rv = DPCPU_PTR(smp_rv_data); ncpus = rv->smp_rv_ncpus; - while (atomic_load_acq_int(&rv->smp_rv_waiters[2]) < ncpus) { + while (atomic_load_acq_int(&rv->smp_rv_waiters) < ncpus) { /* check for incoming events */ if ((stopping_cpus & (1 << curcpu)) != 0) cpustop_handler(); - else if (DPCPU_GET(smp_rv_senders) != 0) - smp_rendezvous_action(); + + count = smp_rendezvous_action_pass(); + if (count != 0) + atomic_add_int(DPCPU_PTR(smp_rv_count), -count); else cpu_spinwait(); } } + +static void +smp_rendezvous_notify(int cpu, int nhold) +{ + int send_ipi; + int x; + + if (cpu == curcpu) + return; + + KASSERT((DPCPU_ID_GET(cpu, smp_rv_senders) & (1 << curcpu)) == 0, + ("curcpu bit is set in target cpu's senders map")); + + /* + * If this is a first action of a rendezvous invocation + * and we are the first to send an event, then send an ipi. + */ + send_ipi = 0; + if (nhold != 0) { + x = atomic_fetchadd_int(DPCPU_ID_PTR(cpu, smp_rv_count), nhold); + send_ipi = (x == 0); + if (!send_ipi) + coalesced_ipi_count++; + } + + atomic_set_rel_int(DPCPU_ID_PTR(cpu, smp_rv_senders), 1 << curcpu); + if (send_ipi) + ipi_cpu(cpu, IPI_RENDEZVOUS); +} + +static void +smp_rendezvous_cpus_oneaction(cpumask_t map, + volatile struct smp_rendezvous_data *rv, + int nhold, + void (*action_func)(void *), + void *arg) +{ + cpumask_t tmp; + int ncpus; + int cpu; + + /* + * If nhold != 0, then this is the first call of a more complex + * rendezvous invocation, so we need to setup some common data + * for all calls and possibly send IPIs to target CPUs. + * Otherwise, we just need to set action_func and the incoming + * rendezvous bits. + */ + if (nhold != 0) { + ncpus = 0; + map &= all_cpus; + tmp = map; + while (tmp != 0) { + cpu = ffs(tmp) - 1; + tmp &= ~(1 << cpu); + ncpus++; + } + + rv->smp_rv_ncpus = ncpus; + rv->smp_rv_func_arg = arg; + } + + rv->smp_rv_action_func = action_func; + atomic_store_rel_int(&rv->smp_rv_waiters, 0); + + tmp = map; + while (tmp != 0) { + cpu = ffs(tmp) - 1; + tmp &= ~(1 << cpu); + + smp_rendezvous_notify(cpu, nhold); + } + + /* Check if the current CPU is in the map */ + if ((map & (1 << curcpu)) != 0) + smp_rendezvous_action_body(curcpu); +} + /* * Execute the action_func on the targeted CPUs. * @@ -542,9 +600,7 @@ smp_rendezvous_cpus(cpumask_t map, void *arg) { volatile struct smp_rendezvous_data *rv; - cpumask_t tmp; - int ncpus; - int cpu; + int nhold; if (!smp_started) { if (setup_func != NULL) @@ -556,65 +612,55 @@ smp_rendezvous_cpus(cpumask_t map, return; } - map &= all_cpus; - tmp = map; - ncpus = 0; - while (tmp != 0) { - cpu = ffs(tmp) - 1; - tmp &= ~(1 << cpu); - ncpus++; - } + nhold = 1; + if (setup_func != smp_no_rendevous_barrier) + nhold++; + if (teardown_func != smp_no_rendevous_barrier) + nhold++; spinlock_enter(); + rv = DPCPU_PTR(smp_rv_data); + + /* Let other CPUs know that we are here, no need to IPI us. */ + atomic_add_int(DPCPU_PTR(smp_rv_count), 1); /* - * First wait for an event previously posted by us to complete (if any), - * this is done in case the event was asynchronous. + * First wait for an event previously posted by us, if any, to complete. * In the future we could have a queue of outgoing events instead * of a single item. */ - smp_rendezvous_wait(); - - /* set static function pointers */ - rv = DPCPU_PTR(smp_rv_data); - rv->smp_rv_ncpus = ncpus; - rv->smp_rv_setup_func = setup_func; - rv->smp_rv_action_func = action_func; - rv->smp_rv_teardown_func = teardown_func; - rv->smp_rv_func_arg = arg; - rv->smp_rv_waiters[1] = 0; - rv->smp_rv_waiters[2] = 0; - atomic_store_rel_int(&rv->smp_rv_waiters[0], 0); - - /* signal other CPUs, which will enter the IPI with interrupts off */ - tmp = map; - while (tmp != 0) { - cpu = ffs(tmp) - 1; - tmp &= ~(1 << cpu); + smp_rendezvous_wait(rv); - if (cpu == curcpu) - continue; + if (setup_func != smp_no_rendevous_barrier) { + smp_rendezvous_cpus_oneaction(map, rv, nhold, setup_func, arg); + smp_rendezvous_wait(rv); + nhold = 0; + } - KASSERT( - (DPCPU_ID_GET(cpu, smp_rv_senders) & (1 << curcpu)) == 0, - ("curcpu bit is set in target cpu's senders map")); - - /* if we are the first to send an event, then send an ipi */ - if (atomic_fetchadd_int(DPCPU_ID_PTR(cpu, smp_rv_count), 1) - == 0) - ipi_cpu(cpu, IPI_RENDEZVOUS); - else - coalesced_ipi_count++; + smp_rendezvous_cpus_oneaction(map, rv, nhold, action_func, arg); - atomic_set_rel_int(DPCPU_ID_PTR(cpu, smp_rv_senders), - 1 << curcpu); + /* + * For now be compatible with historic smp_rendezvous semantics: + * if teardown_func is smp_no_rendevous_barrier, then the master + * CPU waits for target CPUs to complete main action. + * This means that we do not support completely async semantics + * (where the master CPU "fires and forgets" for time being.. + */ +#ifdef notyet + if (teardown_func != smp_no_rendevous_barrier) { + smp_rendezvous_wait(rv); + smp_rendezvous_cpus_oneaction(map, rv, 0, teardown_func, arg); } +#else + smp_rendezvous_wait(rv); + if (teardown_func != smp_no_rendevous_barrier) + smp_rendezvous_cpus_oneaction(map, rv, 0, teardown_func, arg); +#endif + /* We are done with out work. */ + atomic_add_int(DPCPU_PTR(smp_rv_count), -1); - /* Check if the current CPU is in the map */ - if ((map & (1 << curcpu)) != 0) - smp_rendezvous_action_body(curcpu); - if (teardown_func == smp_no_rendevous_barrier) - smp_rendezvous_wait(); + /* Process all pending incoming actions. */ + smp_rendezvous_action(); spinlock_exit(); } From owner-svn-src-user@FreeBSD.ORG Sun May 15 14:32:55 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3364106566B; Sun, 15 May 2011 14:32:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2F8F8FC19; Sun, 15 May 2011 14:32:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FEWtT7042039; Sun, 15 May 2011 14:32:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FEWtTw042031; Sun, 15 May 2011 14:32:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105151432.p4FEWtTw042031@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 May 2011 14:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221962 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 14:32:55 -0000 Author: avg Date: Sun May 15 14:32:55 2011 New Revision: 221962 URL: http://svn.freebsd.org/changeset/base/221962 Log: better name and place for a macro that checks if curthread is panic thread Suggested by: attilio Modified: user/avg/xcpu/sys/kern/kern_mutex.c user/avg/xcpu/sys/kern/kern_rmlock.c user/avg/xcpu/sys/kern/kern_rwlock.c user/avg/xcpu/sys/kern/kern_sx.c user/avg/xcpu/sys/kern/kern_synch.c user/avg/xcpu/sys/sys/proc.h user/avg/xcpu/sys/sys/systm.h Modified: user/avg/xcpu/sys/kern/kern_mutex.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_mutex.c Sun May 15 14:01:23 2011 (r221961) +++ user/avg/xcpu/sys/kern/kern_mutex.c Sun May 15 14:32:55 2011 (r221962) @@ -348,7 +348,7 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t return; } - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; lock_profile_obtain_lock_failed(&m->lock_object, @@ -510,7 +510,7 @@ _mtx_lock_spin(struct mtx *m, uintptr_t uint64_t waittime = 0; #endif - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; if (LOCK_LOG_TEST(&m->lock_object, opts)) @@ -584,7 +584,7 @@ retry: break; } - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; lock_profile_obtain_lock_failed(&m->lock_object, @@ -673,7 +673,7 @@ _mtx_unlock_sleep(struct mtx *m, int opt return; } - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; /* Modified: user/avg/xcpu/sys/kern/kern_rmlock.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_rmlock.c Sun May 15 14:01:23 2011 (r221961) +++ user/avg/xcpu/sys/kern/kern_rmlock.c Sun May 15 14:32:55 2011 (r221962) @@ -279,7 +279,7 @@ _rm_rlock_hard(struct rmlock *rm, struct return (1); } - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return (1); /* @@ -388,7 +388,7 @@ _rm_unlock_hard(struct thread *td,struct if (!tracker->rmp_flags) return; - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; mtx_lock_spin(&rm_spinlock); @@ -442,7 +442,7 @@ _rm_wlock(struct rmlock *rm) else mtx_lock(&rm->rm_lock_mtx); - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; if (rm->rm_writecpus != all_cpus) { Modified: user/avg/xcpu/sys/kern/kern_rwlock.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_rwlock.c Sun May 15 14:01:23 2011 (r221961) +++ user/avg/xcpu/sys/kern/kern_rwlock.c Sun May 15 14:32:55 2011 (r221962) @@ -323,7 +323,7 @@ _rw_rlock(struct rwlock *rw, const char rw->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL); - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; for (;;) { @@ -535,7 +535,7 @@ _rw_runlock(struct rwlock *rw, const cha WITNESS_UNLOCK(&rw->lock_object, 0, file, line); LOCK_LOG_LOCK("RUNLOCK", &rw->lock_object, 0, 0, file, line); - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; /* TODO: drop "owner of record" here. */ @@ -665,7 +665,7 @@ _rw_wlock_hard(struct rwlock *rw, uintpt return; } - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; if (LOCK_LOG_TEST(&rw->lock_object, 0)) @@ -829,7 +829,7 @@ _rw_wunlock_hard(struct rwlock *rw, uint return; } - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; KASSERT(rw->rw_lock & (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS), Modified: user/avg/xcpu/sys/kern/kern_sx.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_sx.c Sun May 15 14:01:23 2011 (r221961) +++ user/avg/xcpu/sys/kern/kern_sx.c Sun May 15 14:32:55 2011 (r221962) @@ -493,7 +493,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t return (0); } - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return (0); if (LOCK_LOG_TEST(&sx->lock_object, 0)) @@ -695,7 +695,7 @@ _sx_xunlock_hard(struct sx *sx, uintptr_ return; } - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; MPASS(sx->sx_lock & (SX_LOCK_SHARED_WAITERS | @@ -760,7 +760,7 @@ _sx_slock_hard(struct sx *sx, int opts, int64_t sleep_time = 0; #endif - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return (0); /* @@ -929,7 +929,7 @@ _sx_sunlock_hard(struct sx *sx, const ch uintptr_t x; int wakeup_swapper; - if (IS_PANIC_THREAD()) + if (THREAD_PANICED()) return; for (;;) { Modified: user/avg/xcpu/sys/kern/kern_synch.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_synch.c Sun May 15 14:01:23 2011 (r221961) +++ user/avg/xcpu/sys/kern/kern_synch.c Sun May 15 14:32:55 2011 (r221962) @@ -158,7 +158,7 @@ _sleep(void *ident, struct lock_object * else class = NULL; - if (cold || IS_PANIC_THREAD()) { + if (cold || THREAD_PANICED()) { /* * During autoconfiguration, just return; * don't run any other threads or panic below, @@ -260,7 +260,7 @@ msleep_spin(void *ident, struct mtx *mtx KASSERT(p != NULL, ("msleep1")); KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); - if (cold || IS_PANIC_THREAD()) { + if (cold || THREAD_PANICED()) { /* * During autoconfiguration, just return; * don't run any other threads or panic below, Modified: user/avg/xcpu/sys/sys/proc.h ============================================================================== --- user/avg/xcpu/sys/sys/proc.h Sun May 15 14:01:23 2011 (r221961) +++ user/avg/xcpu/sys/sys/proc.h Sun May 15 14:32:55 2011 (r221962) @@ -775,6 +775,16 @@ MALLOC_DECLARE(M_SUBPROC); curthread->td_pflags &= ~TDP_NOSLEEPING; \ } while (0) +/* + * If we have already panic'd and this is the thread that called + * panic(), then don't block on any mutexes but silently succeed. + * Otherwise, the kernel will deadlock since the scheduler isn't + * going to run the thread that holds the lock we need. + */ +#define THREAD_PANICED() \ + (panicstr != NULL && (curthread->td_flags & TDF_INPANIC) != 0) + + #define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash]) extern LIST_HEAD(pidhashhead, proc) *pidhashtbl; extern u_long pidhash; Modified: user/avg/xcpu/sys/sys/systm.h ============================================================================== --- user/avg/xcpu/sys/sys/systm.h Sun May 15 14:01:23 2011 (r221961) +++ user/avg/xcpu/sys/sys/systm.h Sun May 15 14:32:55 2011 (r221962) @@ -109,15 +109,6 @@ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUES ((uintptr_t)&(var) & (sizeof(void *) - 1)) == 0, msg) /* - * If we have already panic'd and this is the thread that called - * panic(), then don't block on any mutexes but silently succeed. - * Otherwise, the kernel will deadlock since the scheduler isn't - * going to run the thread that holds the lock we need. - */ -#define IS_PANIC_THREAD() \ - (panicstr != NULL && (curthread->td_flags & TDF_INPANIC) != 0) - -/* * XXX the hints declarations are even more misplaced than most declarations * in this file, since they are needed in one file (per arch) and only used * in two files. From owner-svn-src-user@FreeBSD.ORG Sun May 15 14:58:29 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A324106564A; Sun, 15 May 2011 14:58:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 877CE8FC14; Sun, 15 May 2011 14:58:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FEwTci042583; Sun, 15 May 2011 14:58:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FEwTNX042581; Sun, 15 May 2011 14:58:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105151458.p4FEwTNX042581@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 May 2011 14:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221963 - user/avg/xcpu/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 14:58:29 -0000 Author: avg Date: Sun May 15 14:58:29 2011 New Revision: 221963 URL: http://svn.freebsd.org/changeset/base/221963 Log: [fixup] a style nit Modified: user/avg/xcpu/sys/kern/subr_smp.c Modified: user/avg/xcpu/sys/kern/subr_smp.c ============================================================================== --- user/avg/xcpu/sys/kern/subr_smp.c Sun May 15 14:32:55 2011 (r221962) +++ user/avg/xcpu/sys/kern/subr_smp.c Sun May 15 14:58:29 2011 (r221963) @@ -120,7 +120,7 @@ struct smp_rendezvous_data { int smp_rv_ncpus; }; -volatile static DPCPU_DEFINE(struct smp_rendezvous_data, smp_rv_data); +static volatile DPCPU_DEFINE(struct smp_rendezvous_data, smp_rv_data); static volatile DPCPU_DEFINE(cpumask_t, smp_rv_senders); static volatile DPCPU_DEFINE(cpumask_t, smp_rv_count); From owner-svn-src-user@FreeBSD.ORG Sun May 15 15:08:01 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AD89106566B; Sun, 15 May 2011 15:08:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 163B18FC0A; Sun, 15 May 2011 15:08:00 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id F22912A29126; Sun, 15 May 2011 17:07:59 +0200 (CEST) Date: Sun, 15 May 2011 17:07:59 +0200 From: Ed Schouten To: Andriy Gapon Message-ID: <20110515150759.GI111@hoeg.nl> References: <201105151432.p4FEWtTw042031@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AzNpbZlgThVzWita" Content-Disposition: inline In-Reply-To: <201105151432.p4FEWtTw042031@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r221962 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 15:08:01 -0000 --AzNpbZlgThVzWita Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Andriy, * Andriy Gapon , 20110515 16:32: > - if (IS_PANIC_THREAD()) > + if (THREAD_PANICED()) Shouldn't this be called THREAD_PANICKED(), with the k, instead? --=20 Ed Schouten WWW: http://80386.nl/ --AzNpbZlgThVzWita Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQIcBAEBAgAGBQJNz+xPAAoJEG5e2P40kaK7/vwP/30zs/0GRU4TdPr1lcyM72bo KeyC+kn+tIVn8Ws5KWd6LTLMh3iEJ6qmlChnQU4BJTKPfTeM3zluYnU+zWFkw5SP +856xBb2bstoIoLpp8DQHBAXoj0klBC5VV5pjR07bfCxUPvLGgJIreuMijqL9Gad Q3nX5sdT2ZSfZn8K35qEn+2OyxJfU/oIvKSKF+hASQO+k+OdAwVxtzX4a1/mnXxd YwvcrxPE0batXQbwpuRc8wxDKReIrPMJ9Pl9/IkCUvlIKDTwNqeG4KkM0G1EXGXy im8hoH6+HWah5Z1ukRwXN1b+GMcmd6iplTTBoTZ8YSHOjPOwzYuwljjhJsIqHtt6 A552/62qe/iWzyzi0pxnDMxa3pRXf7b3R75Kxi8OqVbJwKkAXinN5ZusfXLtGX2T M2yp3N0ApER1u+XuzDm1qhZ17OrmBY/9a5vY9OMK3PEkfeVal/FDTWy5iZdVGkrO KaFQu4i1BZlZ+0QLXlVZqp/KljAwGGRtwH5gYciV/Iq+cU7tw2RJtVa5d92qAXhL Df8+zspgps+YVDUFkVdqVsmIbHaRlW4M68Jt1iYWEfeV6CtS6odZDGmiUitTSeZW wECSAuRG/Jz8o5U51mxFMlNPXnpe+I3Q4owvJ2Nbd2cmt3iEuDJzM2B6XzlCMMHV J0YL/8/irEsH4VEx88nQ =aHtB -----END PGP SIGNATURE----- --AzNpbZlgThVzWita-- From owner-svn-src-user@FreeBSD.ORG Sun May 15 15:14:09 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7ADD106564A for ; Sun, 15 May 2011 15:14:09 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 727FF8FC18 for ; Sun, 15 May 2011 15:14:09 +0000 (UTC) Received: by gyg13 with SMTP id 13so1620078gyg.13 for ; Sun, 15 May 2011 08:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=TeEOM8gyvth8blqBLnqPEnmGO2WCuYQ3JJx4a/Rlu1M=; b=BM/yKaVpYJ3ZgNH5P3ZfW9xwhhLXW1hFmNBVuq/Mzsg67643aZW+IOPinUSNge8A+O uWW9EJRS16ReumF1aoWpflS6jFRXiTorLrE8sVbMNp2h+iS9i5ernMnJPDpfpI0G8dLP ZQ5mtSShgfa5WCuSBx0sn6HYe0LelfdpKAycs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=P07N1TnY+SYnjmQ2dkQPQo15ZFfFMuHAz9pIKnx3eA6laAm0OS/zEPrj/8ehoq9WcK 0bTjVu5PR6NiH1eOIvQG28/OQEt/63uUvDncPEMP5hGEsAA1DLoGzZIpxYKf3nlZTAU7 GRITOyfLqoyErwLAVY9C0XE2/P/ZxdKVO3WUk= MIME-Version: 1.0 Received: by 10.236.192.230 with SMTP id i66mr3286361yhn.482.1305470776699; Sun, 15 May 2011 07:46:16 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.103.130 with HTTP; Sun, 15 May 2011 07:46:16 -0700 (PDT) In-Reply-To: <201105151432.p4FEWtTw042031@svn.freebsd.org> References: <201105151432.p4FEWtTw042031@svn.freebsd.org> Date: Sun, 15 May 2011 16:46:16 +0200 X-Google-Sender-Auth: IA75IwqcR7OW5UMJoAkiS8rwxfw Message-ID: From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r221962 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 15:14:09 -0000 2011/5/15 Andriy Gapon : > Author: avg > Date: Sun May 15 14:32:55 2011 > New Revision: 221962 > URL: http://svn.freebsd.org/changeset/base/221962 > > Log: > =C2=A0better name and place for a macro that checks if curthread is panic= thread I also suggested to let it grow a thread argument, but I really don't have a strong argument here. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-user@FreeBSD.ORG Sun May 15 16:10:47 2011 Return-Path: Delivered-To: svn-src-user@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9D2B106564A; Sun, 15 May 2011 16:10:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A439A8FC14; Sun, 15 May 2011 16:10:41 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA13581; Sun, 15 May 2011 19:10:39 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QLdtv-0000Gw-BH; Sun, 15 May 2011 19:10:39 +0300 Message-ID: <4DCFFAFF.7020403@FreeBSD.org> Date: Sun, 15 May 2011 19:10:39 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ed Schouten References: <201105151432.p4FEWtTw042031@svn.freebsd.org> <20110515150759.GI111@hoeg.nl> In-Reply-To: <20110515150759.GI111@hoeg.nl> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-user@FreeBSD.org Subject: Re: svn commit: r221962 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 16:10:47 -0000 on 15/05/2011 18:07 Ed Schouten said the following: > Hey Andriy, > > * Andriy Gapon , 20110515 16:32: >> - if (IS_PANIC_THREAD()) >> + if (THREAD_PANICED()) > > Shouldn't this be called THREAD_PANICKED(), with the k, instead? > Yes, it should be. Thank you. -- Andriy Gapon From owner-svn-src-user@FreeBSD.ORG Sun May 15 16:15:40 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22531106564A; Sun, 15 May 2011 16:15:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1252C8FC1A; Sun, 15 May 2011 16:15:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FGFdnT044178; Sun, 15 May 2011 16:15:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FGFdBl044172; Sun, 15 May 2011 16:15:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105151615.p4FGFdBl044172@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 May 2011 16:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221966 - user/avg/xcpu/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 16:15:40 -0000 Author: avg Date: Sun May 15 16:15:39 2011 New Revision: 221966 URL: http://svn.freebsd.org/changeset/base/221966 Log: [fixup] fix a typo in a macro name Pointed out by: emaste Modified: user/avg/xcpu/sys/kern/kern_mutex.c user/avg/xcpu/sys/kern/kern_rmlock.c user/avg/xcpu/sys/kern/kern_rwlock.c user/avg/xcpu/sys/kern/kern_sx.c user/avg/xcpu/sys/kern/kern_synch.c Modified: user/avg/xcpu/sys/kern/kern_mutex.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_mutex.c Sun May 15 15:54:34 2011 (r221965) +++ user/avg/xcpu/sys/kern/kern_mutex.c Sun May 15 16:15:39 2011 (r221966) @@ -348,7 +348,7 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t return; } - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; lock_profile_obtain_lock_failed(&m->lock_object, @@ -510,7 +510,7 @@ _mtx_lock_spin(struct mtx *m, uintptr_t uint64_t waittime = 0; #endif - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; if (LOCK_LOG_TEST(&m->lock_object, opts)) @@ -584,7 +584,7 @@ retry: break; } - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; lock_profile_obtain_lock_failed(&m->lock_object, @@ -673,7 +673,7 @@ _mtx_unlock_sleep(struct mtx *m, int opt return; } - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; /* Modified: user/avg/xcpu/sys/kern/kern_rmlock.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_rmlock.c Sun May 15 15:54:34 2011 (r221965) +++ user/avg/xcpu/sys/kern/kern_rmlock.c Sun May 15 16:15:39 2011 (r221966) @@ -279,7 +279,7 @@ _rm_rlock_hard(struct rmlock *rm, struct return (1); } - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return (1); /* @@ -388,7 +388,7 @@ _rm_unlock_hard(struct thread *td,struct if (!tracker->rmp_flags) return; - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; mtx_lock_spin(&rm_spinlock); @@ -442,7 +442,7 @@ _rm_wlock(struct rmlock *rm) else mtx_lock(&rm->rm_lock_mtx); - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; if (rm->rm_writecpus != all_cpus) { Modified: user/avg/xcpu/sys/kern/kern_rwlock.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_rwlock.c Sun May 15 15:54:34 2011 (r221965) +++ user/avg/xcpu/sys/kern/kern_rwlock.c Sun May 15 16:15:39 2011 (r221966) @@ -323,7 +323,7 @@ _rw_rlock(struct rwlock *rw, const char rw->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL); - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; for (;;) { @@ -535,7 +535,7 @@ _rw_runlock(struct rwlock *rw, const cha WITNESS_UNLOCK(&rw->lock_object, 0, file, line); LOCK_LOG_LOCK("RUNLOCK", &rw->lock_object, 0, 0, file, line); - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; /* TODO: drop "owner of record" here. */ @@ -665,7 +665,7 @@ _rw_wlock_hard(struct rwlock *rw, uintpt return; } - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; if (LOCK_LOG_TEST(&rw->lock_object, 0)) @@ -829,7 +829,7 @@ _rw_wunlock_hard(struct rwlock *rw, uint return; } - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; KASSERT(rw->rw_lock & (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS), Modified: user/avg/xcpu/sys/kern/kern_sx.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_sx.c Sun May 15 15:54:34 2011 (r221965) +++ user/avg/xcpu/sys/kern/kern_sx.c Sun May 15 16:15:39 2011 (r221966) @@ -493,7 +493,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t return (0); } - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return (0); if (LOCK_LOG_TEST(&sx->lock_object, 0)) @@ -695,7 +695,7 @@ _sx_xunlock_hard(struct sx *sx, uintptr_ return; } - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; MPASS(sx->sx_lock & (SX_LOCK_SHARED_WAITERS | @@ -760,7 +760,7 @@ _sx_slock_hard(struct sx *sx, int opts, int64_t sleep_time = 0; #endif - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return (0); /* @@ -929,7 +929,7 @@ _sx_sunlock_hard(struct sx *sx, const ch uintptr_t x; int wakeup_swapper; - if (THREAD_PANICED()) + if (THREAD_PANICKED()) return; for (;;) { Modified: user/avg/xcpu/sys/kern/kern_synch.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_synch.c Sun May 15 15:54:34 2011 (r221965) +++ user/avg/xcpu/sys/kern/kern_synch.c Sun May 15 16:15:39 2011 (r221966) @@ -158,7 +158,7 @@ _sleep(void *ident, struct lock_object * else class = NULL; - if (cold || THREAD_PANICED()) { + if (cold || THREAD_PANICKED()) { /* * During autoconfiguration, just return; * don't run any other threads or panic below, @@ -260,7 +260,7 @@ msleep_spin(void *ident, struct mtx *mtx KASSERT(p != NULL, ("msleep1")); KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); - if (cold || THREAD_PANICED()) { + if (cold || THREAD_PANICKED()) { /* * During autoconfiguration, just return; * don't run any other threads or panic below, From owner-svn-src-user@FreeBSD.ORG Sun May 15 16:33:14 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A6EC1065676; Sun, 15 May 2011 16:33:14 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E32FF8FC1F; Sun, 15 May 2011 16:33:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FGXDt0044613; Sun, 15 May 2011 16:33:13 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FGXD8R044607; Sun, 15 May 2011 16:33:13 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201105151633.p4FGXD8R044607@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 15 May 2011 16:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221968 - in user/gabor/tre-integration: contrib/tre contrib/tre/src lib/libc/regex usr.bin usr.bin/agrep X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 16:33:14 -0000 Author: gabor Date: Sun May 15 16:33:13 2011 New Revision: 221968 URL: http://svn.freebsd.org/changeset/base/221968 Log: - Add agrep to the build Added: user/gabor/tre-integration/usr.bin/agrep/ user/gabor/tre-integration/usr.bin/agrep/Makefile (contents, props changed) Modified: user/gabor/tre-integration/contrib/tre/config.h user/gabor/tre-integration/contrib/tre/src/agrep.c user/gabor/tre-integration/lib/libc/regex/Symbol.map user/gabor/tre-integration/usr.bin/Makefile Modified: user/gabor/tre-integration/contrib/tre/config.h ============================================================================== --- user/gabor/tre-integration/contrib/tre/config.h Sun May 15 16:16:48 2011 (r221967) +++ user/gabor/tre-integration/contrib/tre/config.h Sun May 15 16:33:13 2011 (r221968) @@ -154,3 +154,5 @@ /* Version number of package */ #define VERSION "0.8.0" + +#define PACKAGE_BUGREPORT "tre-general@lists.laurikari.net" Modified: user/gabor/tre-integration/contrib/tre/src/agrep.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/src/agrep.c Sun May 15 16:16:48 2011 (r221967) +++ user/gabor/tre-integration/contrib/tre/src/agrep.c Sun May 15 16:33:13 2011 (r221968) @@ -23,7 +23,7 @@ #ifdef HAVE_GETOPT_H #include #endif /* HAVE_GETOPT_H */ -#include "regex.h" +#include #ifdef HAVE_GETTEXT #include Modified: user/gabor/tre-integration/lib/libc/regex/Symbol.map ============================================================================== --- user/gabor/tre-integration/lib/libc/regex/Symbol.map Sun May 15 16:16:48 2011 (r221967) +++ user/gabor/tre-integration/lib/libc/regex/Symbol.map Sun May 15 16:33:13 2011 (r221968) @@ -3,10 +3,12 @@ */ FBSD_1.2 { + tre_config; tre_regacomp; tre_regaexec; tre_regancomp; tre_reganexec; + tre_regaparams_default; tre_regawncomp; tre_regawnexec; tre_regcomp; Modified: user/gabor/tre-integration/usr.bin/Makefile ============================================================================== --- user/gabor/tre-integration/usr.bin/Makefile Sun May 15 16:16:48 2011 (r221967) +++ user/gabor/tre-integration/usr.bin/Makefile Sun May 15 16:33:13 2011 (r221968) @@ -9,7 +9,8 @@ # Moved to secure: bdes # -SUBDIR= alias \ +SUBDIR= agrep \ + alias \ apply \ asa \ awk \ Added: user/gabor/tre-integration/usr.bin/agrep/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/usr.bin/agrep/Makefile Sun May 15 16:33:13 2011 (r221968) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../contrib/tre/src ${.CURDIR}/../../contrib/tre/doc +PROG= agrep + +CFLAGS+=-DHAVE_CONFIG_H -I${.CURDIR}/../../contrib/tre \ + -I${.CURDIR}/../../include +WARNS?= 6 + +.include From owner-svn-src-user@FreeBSD.ORG Sun May 15 16:43:51 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DCE2106566B; Sun, 15 May 2011 16:43:51 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7DA5D8FC13; Sun, 15 May 2011 16:43:50 +0000 (UTC) Received: by wyf23 with SMTP id 23so3905429wyf.13 for ; Sun, 15 May 2011 09:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=C1C6OXBXP6YsLM3JtfsTiRR1w4W01GVPR0LrksOsGds=; b=gf0oOKF0yW21lOkuPCdUCf41crVF6zXZv6NeCMcscDdkxXk6XXH+8RpqD6BEqFfq+3 cF+k2I+wCs+Yf0NbCGqCext93lNGa3TkgLuwUTLOTFFIylaIknidHw5SqzEp/y5XZ+pl Yk0cn32d1oAal+7eaQg215ayJ3s1rin13YEMU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=kWsBssihSTDFOeZlYjH1P+JhrN2FfwD8hy4s/WdKhOJVNtwmb/pIY4K1VXtH4Ce5Ef kL82pzixyao9HELMJy2ysG9DTa7+A0dDqw4ed5BMFalQOcmqQAgfiQlPU2BfiCN/EH0w Dra6B2e+6FN3hZQvaqR1A2pvjhsQxQ+qfA17A= MIME-Version: 1.0 Received: by 10.216.79.10 with SMTP id h10mr57389wee.20.1305476387675; Sun, 15 May 2011 09:19:47 -0700 (PDT) Received: by 10.216.153.104 with HTTP; Sun, 15 May 2011 09:19:47 -0700 (PDT) In-Reply-To: <4DCFFAFF.7020403@FreeBSD.org> References: <201105151432.p4FEWtTw042031@svn.freebsd.org> <20110515150759.GI111@hoeg.nl> <4DCFFAFF.7020403@FreeBSD.org> Date: Sun, 15 May 2011 09:19:47 -0700 Message-ID: From: Matthew Fleming To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Ed Schouten , "src-committers@freebsd.org" , "svn-src-user@freebsd.org" Subject: Re: svn commit: r221962 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 16:43:51 -0000 On Sunday, May 15, 2011, Andriy Gapon wrote: > on 15/05/2011 18:07 Ed Schouten said the following: >> Hey Andriy, >> >> * Andriy Gapon , 20110515 16:32: >>> - =A0 =A0if (IS_PANIC_THREAD()) >>> + =A0 =A0if (THREAD_PANICED()) >> >> Shouldn't this be called THREAD_PANICKED(), with the k, instead? >> > > Yes, it should be. =A0Thank you. Shouldn't it be TD_IS_PANIC[K]ED to match many of the other checks like TD_IS_IDLETHREAD? Or perhaps to avoid a spelling change, TD_IS_INPANIC? Thanks, matthew From owner-svn-src-user@FreeBSD.ORG Sun May 15 16:53:58 2011 Return-Path: Delivered-To: svn-src-user@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56E91106566C; Sun, 15 May 2011 16:53:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6566B8FC12; Sun, 15 May 2011 16:53:57 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA14052; Sun, 15 May 2011 19:53:55 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QLeZm-0000JZ-Mx; Sun, 15 May 2011 19:53:54 +0300 Message-ID: <4DD00522.2010309@FreeBSD.org> Date: Sun, 15 May 2011 19:53:54 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Matthew Fleming References: <201105151432.p4FEWtTw042031@svn.freebsd.org> <20110515150759.GI111@hoeg.nl> <4DCFFAFF.7020403@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Ed Schouten , "src-committers@freebsd.org" , "svn-src-user@freebsd.org" Subject: Re: svn commit: r221962 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 16:53:58 -0000 on 15/05/2011 19:19 Matthew Fleming said the following: > On Sunday, May 15, 2011, Andriy Gapon wrote: >> on 15/05/2011 18:07 Ed Schouten said the following: >>> Hey Andriy, >>> >>> * Andriy Gapon , 20110515 16:32: >>>> - if (IS_PANIC_THREAD()) >>>> + if (THREAD_PANICED()) >>> >>> Shouldn't this be called THREAD_PANICKED(), with the k, instead? >>> >> >> Yes, it should be. Thank you. > > Shouldn't it be TD_IS_PANIC[K]ED to match many of the other checks > like TD_IS_IDLETHREAD? Or perhaps to avoid a spelling change, > TD_IS_INPANIC? I like both of your proposals. Where have you been before? :) Ok, let's now settle on one best name and I will do another rename, that's easy to do. -- Andriy Gapon From owner-svn-src-user@FreeBSD.ORG Sun May 15 17:06:26 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E938E106566B; Sun, 15 May 2011 17:06:26 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4698FC08; Sun, 15 May 2011 17:06:26 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id AF81C2A29125; Sun, 15 May 2011 19:06:25 +0200 (CEST) Date: Sun, 15 May 2011 19:06:25 +0200 From: Ed Schouten To: Andriy Gapon Message-ID: <20110515170625.GJ111@hoeg.nl> References: <201105151615.p4FGFdBl044172@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KrHCbChajFcK0yQE" Content-Disposition: inline In-Reply-To: <201105151615.p4FGFdBl044172@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r221966 - user/avg/xcpu/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 17:06:27 -0000 --KrHCbChajFcK0yQE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Andriy Gapon , 20110515 18:15: > Pointed out by: emaste ;-) --=20 Ed Schouten WWW: http://80386.nl/ --KrHCbChajFcK0yQE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQIcBAEBAgAGBQJN0AgRAAoJEG5e2P40kaK7uVEP/3NMHT0r2IImI4ZbbUAjG7E7 PJyotn8OCnF/rpUGXlTiJmGE4l3ri8P8zNQ3GcBAEf+VaiUVXWc7rBXJ+BRF7Vt2 y6NwonXLZA16Li654mkQMtQ0tBoJg9R6D/mntt+iB5cyNJCjHNnH9JjQmSgWKdUW JiIbckNi6S9Fiabh8Z53jtrERPkwo2SRdpBOTmvY/zIHyxY47GoRW/8iFRI5eoYw 2MWRkW1OzXihp786NAr6smkvM+u93jep/5XHDhIhsusBAzdP1XVkOoOCR1TMQ/KH 6fG/P21GIghYPQu41LVFj4Nqcxxq8mcgzyV5CV5SCjGm5Fo22oLB41ex+UVdNp+Y 7zAr3AhE2aXiT6bcrOH8WM2t57xSshvp8b5y+fYl7RYgzYxf703PIs+BUgNiaScg tvZcvNpzXgZmq1AvVKeYyJKwnKid/1yACg0k2X8ig2upp8CNwNrHOPfFlk46lY0M v71J93SWxXlyX/U902jd9tk9OHD3CSqIMUZFinRjkSdKf+U8SWa3dCPbESyTZSQP 7LBPVPczPO2rjPhxpxwtsb+lRD2T60zreToHJh83+lR8Y8jsATSGDWnmKn8H9T8p AqjBLSu33Uh0jwPySGrYeg9SMEQWdc2RJKsUGYobOkOmtMzlWOyCATZ0OcLuto6D On13BO0qYbY457Bt+tI7 =WiG2 -----END PGP SIGNATURE----- --KrHCbChajFcK0yQE-- From owner-svn-src-user@FreeBSD.ORG Sun May 15 17:17:17 2011 Return-Path: Delivered-To: svn-src-user@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83839106566B; Sun, 15 May 2011 17:17:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 80E9B8FC12; Sun, 15 May 2011 17:17:16 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA14286; Sun, 15 May 2011 20:17:14 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QLewM-0000L3-8t; Sun, 15 May 2011 20:17:14 +0300 Message-ID: <4DD00A98.8060900@FreeBSD.org> Date: Sun, 15 May 2011 20:17:12 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ed Schouten References: <201105151615.p4FGFdBl044172@svn.freebsd.org> <20110515170625.GJ111@hoeg.nl> In-Reply-To: <20110515170625.GJ111@hoeg.nl> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-user@FreeBSD.org Subject: Re: svn commit: r221966 - user/avg/xcpu/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 17:17:17 -0000 on 15/05/2011 20:06 Ed Schouten said the following: > * Andriy Gapon , 20110515 18:15: >> Pointed out by: emaste > > ;-) > Oops, sorry! :) -- Andriy Gapon From owner-svn-src-user@FreeBSD.ORG Sun May 15 23:10:14 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FCB91065670; Sun, 15 May 2011 23:10:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53F118FC13; Sun, 15 May 2011 23:10:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FNAE3t056520; Sun, 15 May 2011 23:10:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FNAEYS056515; Sun, 15 May 2011 23:10:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201105152310.p4FNAEYS056515@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 15 May 2011 23:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221977 - in user/des/svnsup: bin/distill include/svnsup lib/libsvnsup X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 23:10:14 -0000 Author: des Date: Sun May 15 23:10:13 2011 New Revision: 221977 URL: http://svn.freebsd.org/changeset/base/221977 Log: Add support for writing the delta to a file instead of stdout. In svnsup_delta_shorten_path(), fix the case where the path is empty, i.e. the delta is relative to the root of the repo. Modified: user/des/svnsup/bin/distill/distill.c user/des/svnsup/include/svnsup/delta.h user/des/svnsup/include/svnsup/error.h user/des/svnsup/lib/libsvnsup/svnsup_delta.c Modified: user/des/svnsup/bin/distill/distill.c ============================================================================== --- user/des/svnsup/bin/distill/distill.c Sun May 15 22:46:45 2011 (r221976) +++ user/des/svnsup/bin/distill/distill.c Sun May 15 23:10:13 2011 (r221977) @@ -43,7 +43,7 @@ int extended; /* generated extended de int verbose; /* show messages from libsvn */ static int -distill(const char *url, unsigned long revision) +distill(const char *url, unsigned long revision, const char *ofn) { apr_hash_t *config; apr_pool_t *pool; @@ -94,7 +94,7 @@ distill(const char *url, unsigned long r ++subdir; /* XXX create delta */ - err = svnsup_create_delta(&sd); + err = svnsup_create_delta(&sd, ofn); SVNSUP_SVNSUP_ERROR(err, "svnsup_delta_create()"); err = svnsup_delta_root(sd, root); SVNSUP_SVNSUP_ERROR(err, "svnsup_delta_root()"); @@ -126,7 +126,7 @@ static void usage(void) { - fprintf(stderr, "usage: svnsup-distill [-dev] url rev\n"); + fprintf(stderr, "usage: svnsup-distill [-dev] [-o file] url rev\n"); exit(1); } @@ -134,12 +134,13 @@ int main(int argc, char *argv[]) { apr_status_t status; + const char *ofn = NULL; const char *url; char *end, *revstr; unsigned long rev; int opt, ret; - while ((opt = getopt(argc, argv, "dev")) != -1) + while ((opt = getopt(argc, argv, "deo:v")) != -1) switch (opt) { case 'd': ++debug; @@ -147,6 +148,9 @@ main(int argc, char *argv[]) case 'e': ++extended; break; + case 'o': + ofn = optarg; + break; case 'v': ++verbose; break; @@ -172,7 +176,7 @@ main(int argc, char *argv[]) if (status != APR_SUCCESS) return (1); - ret = distill(url, rev); + ret = distill(url, rev, ofn); apr_terminate(); return (ret); Modified: user/des/svnsup/include/svnsup/delta.h ============================================================================== --- user/des/svnsup/include/svnsup/delta.h Sun May 15 22:46:45 2011 (r221976) +++ user/des/svnsup/include/svnsup/delta.h Sun May 15 23:10:13 2011 (r221977) @@ -33,7 +33,7 @@ typedef struct svnsup_delta *svnsup_delta_t; typedef struct svnsup_delta_file *svnsup_delta_file_t; -int svnsup_create_delta(svnsup_delta_t *); +int svnsup_create_delta(svnsup_delta_t *, const char *); int svnsup_close_delta(svnsup_delta_t); int svnsup_delta_root(svnsup_delta_t, const char *); Modified: user/des/svnsup/include/svnsup/error.h ============================================================================== --- user/des/svnsup/include/svnsup/error.h Sun May 15 22:46:45 2011 (r221976) +++ user/des/svnsup/include/svnsup/error.h Sun May 15 23:10:13 2011 (r221977) @@ -32,6 +32,7 @@ typedef enum svnsup_err { SVNSUP_ERR_NONE, + SVNSUP_ERR_FILE, SVNSUP_ERR_MEMORY, SVNSUP_ERR_UNKNOWN, SVNSUP_ERR_MAX, Modified: user/des/svnsup/lib/libsvnsup/svnsup_delta.c ============================================================================== --- user/des/svnsup/lib/libsvnsup/svnsup_delta.c Sun May 15 22:46:45 2011 (r221976) +++ user/des/svnsup/lib/libsvnsup/svnsup_delta.c Sun May 15 23:10:13 2011 (r221977) @@ -90,6 +90,10 @@ static const char * svnsup_delta_shorten_path(svnsup_delta_t sd, const char *pn) { + assert(sd->path != NULL); + assert(pn != NULL); + if (*sd->path == '\0') + return (pn); assert(strstr(pn, sd->path) == pn); pn += strlen(sd->path); assert(*pn == '/' || *pn == '\0'); @@ -102,13 +106,18 @@ svnsup_delta_shorten_path(svnsup_delta_t * Create an svnsup delta. */ int -svnsup_create_delta(svnsup_delta_t *sdp) +svnsup_create_delta(svnsup_delta_t *sdp, const char *ofn) { svnsup_delta_t sd; if ((sd = calloc(1, sizeof *sd)) == NULL) return (SVNSUP_ERR_MEMORY); - sd->f = stdout; + if (ofn == NULL) { + sd->f = stdout; + } else if ((sd->f = fopen(ofn, "w")) == NULL) { + free(sd); + return (SVNSUP_ERR_FILE); + } *sdp = sd; return (SVNSUP_ERR_NONE); } From owner-svn-src-user@FreeBSD.ORG Sun May 15 23:32:32 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D2FC1065672; Sun, 15 May 2011 23:32:32 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 659D48FC08; Sun, 15 May 2011 23:32:30 +0000 (UTC) Received: by wyf23 with SMTP id 23so4066875wyf.13 for ; Sun, 15 May 2011 16:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ZWMdPwxy0eAwzaGCEH0q5F1dBIKhtj/TIgUxmyz5QQ0=; b=mn2LyaCrTlEFWuHdTCMhztQFLKA2YcjKlLCnHWIFJVNfy8VUuqp682R9SL2gNHn2YY aOZOGIflmMZzGnE3Y2S1ItDss/WHxe9J1V+6gnOFZhyKyoa3gmXPbz47O0GklAu8PQw1 iUSXLOLCuq3HSlj5DmjNhgY4KV7o/L4YkTq6o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=kj4JYo+EUT5+uId2feFyySfTHfqVY9hfeWiiNYCCetk0P95TH526XpjMPT8/wkP6nN 4gN9uxx3CWIEggrr9Bd/h/gQvHz23oU0OJZ+eMciJeVCEZxeyEkPam6vtI32fdIDLiJ/ ARSxNSHcri6z0W2IcV9IojSyPPiXe1Q9YZrCA= MIME-Version: 1.0 Received: by 10.216.79.10 with SMTP id h10mr283869wee.20.1305502350097; Sun, 15 May 2011 16:32:30 -0700 (PDT) Received: by 10.216.153.104 with HTTP; Sun, 15 May 2011 16:32:30 -0700 (PDT) In-Reply-To: <4DD00522.2010309@FreeBSD.org> References: <201105151432.p4FEWtTw042031@svn.freebsd.org> <20110515150759.GI111@hoeg.nl> <4DCFFAFF.7020403@FreeBSD.org> <4DD00522.2010309@FreeBSD.org> Date: Sun, 15 May 2011 16:32:30 -0700 Message-ID: From: Matthew Fleming To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Ed Schouten , "src-committers@freebsd.org" , "svn-src-user@freebsd.org" Subject: Re: svn commit: r221962 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 23:32:32 -0000 On Sunday, May 15, 2011, Andriy Gapon wrote: > on 15/05/2011 19:19 Matthew Fleming said the following: >> On Sunday, May 15, 2011, Andriy Gapon wrote: >>> on 15/05/2011 18:07 Ed Schouten said the following: >>>> Hey Andriy, >>>> >>>> * Andriy Gapon , 20110515 16:32: >>>>> - =A0 =A0if (IS_PANIC_THREAD()) >>>>> + =A0 =A0if (THREAD_PANICED()) >>>> >>>> Shouldn't this be called THREAD_PANICKED(), with the k, instead? >>>> >>> >>> Yes, it should be. =A0Thank you. >> >> Shouldn't it be TD_IS_PANIC[K]ED to match many of the other checks >> like TD_IS_IDLETHREAD? =A0Or perhaps to avoid a spelling change, >> TD_IS_INPANIC? > > I like both of your proposals. =A0Where have you been before? :) > Ok, let's now settle on one best name and I will do another rename, that'= s easy > to do. Maybe I should start reading commits to private branches more often. :-) Cheers, matthew From owner-svn-src-user@FreeBSD.ORG Sun May 15 23:54:46 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27FC4106564A; Sun, 15 May 2011 23:54:46 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F14AF8FC08; Sun, 15 May 2011 23:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FNsj23057848; Sun, 15 May 2011 23:54:45 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FNsjL7057843; Sun, 15 May 2011 23:54:45 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201105152354.p4FNsjL7057843@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 15 May 2011 23:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221978 - in user/des/svnsup: bin/distill include/svnsup lib/libsvnsup X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 23:54:46 -0000 Author: des Date: Sun May 15 23:54:45 2011 New Revision: 221978 URL: http://svn.freebsd.org/changeset/base/221978 Log: Include the revision number in the delta. Modified: user/des/svnsup/bin/distill/distill.c user/des/svnsup/include/svnsup/delta.h user/des/svnsup/lib/libsvnsup/svnsup_delta.c Modified: user/des/svnsup/bin/distill/distill.c ============================================================================== --- user/des/svnsup/bin/distill/distill.c Sun May 15 23:10:13 2011 (r221977) +++ user/des/svnsup/bin/distill/distill.c Sun May 15 23:54:45 2011 (r221978) @@ -102,6 +102,8 @@ distill(const char *url, unsigned long r SVNSUP_SVNSUP_ERROR(err, "svnsup_delta_uuid()"); err = svnsup_delta_path(sd, subdir); SVNSUP_SVNSUP_ERROR(err, "svnsup_delta_path()"); + err = svnsup_delta_revision(sd, revision); + SVNSUP_SVNSUP_ERROR(err, "svnsup_delta_revision()"); /* get revision metadata */ error = svn_ra_get_log2(ra_session, NULL, revision, revision, 0, Modified: user/des/svnsup/include/svnsup/delta.h ============================================================================== --- user/des/svnsup/include/svnsup/delta.h Sun May 15 23:10:13 2011 (r221977) +++ user/des/svnsup/include/svnsup/delta.h Sun May 15 23:54:45 2011 (r221978) @@ -39,6 +39,7 @@ int svnsup_close_delta(svnsup_delta_t); int svnsup_delta_root(svnsup_delta_t, const char *); int svnsup_delta_uuid(svnsup_delta_t, const char *); int svnsup_delta_path(svnsup_delta_t, const char *); +int svnsup_delta_revision(svnsup_delta_t, unsigned long); int svnsup_delta_comment(svnsup_delta_t, const char *, ...); int svnsup_delta_meta(svnsup_delta_t, const char *, const char *, ...); int svnsup_delta_create_directory(svnsup_delta_t, const char *); Modified: user/des/svnsup/lib/libsvnsup/svnsup_delta.c ============================================================================== --- user/des/svnsup/lib/libsvnsup/svnsup_delta.c Sun May 15 23:10:13 2011 (r221977) +++ user/des/svnsup/lib/libsvnsup/svnsup_delta.c Sun May 15 23:54:45 2011 (r221978) @@ -50,6 +50,7 @@ struct svnsup_delta { const char *root; const char *uuid; const char *path; + unsigned long revision; struct svnsup_delta_file *sdf; unsigned int ntxt; }; @@ -242,6 +243,20 @@ svnsup_delta_path(svnsup_delta_t sd, con } /* + * Revision + */ +int +svnsup_delta_revision(svnsup_delta_t sd, unsigned long revision) +{ + + assert(sd->revision == 0); + sd->revision = revision; + fprintf(sd->f, "@revision %lu\n", sd->revision); + return (SVNSUP_ERR_NONE); +} + + +/* * Create a directory */ int From owner-svn-src-user@FreeBSD.ORG Wed May 18 15:08:31 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43C4C106566C; Wed, 18 May 2011 15:08:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 280D78FC0A; Wed, 18 May 2011 15:08:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IF8Vt6096848; Wed, 18 May 2011 15:08:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IF8UoS096841; Wed, 18 May 2011 15:08:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105181508.p4IF8UoS096841@svn.freebsd.org> From: Andriy Gapon Date: Wed, 18 May 2011 15:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222060 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 15:08:31 -0000 Author: avg Date: Wed May 18 15:08:30 2011 New Revision: 222060 URL: http://svn.freebsd.org/changeset/base/222060 Log: pick even better name for the panic thread macro Hopefully this is a final choice. Suggested by: mdf Modified: user/avg/xcpu/sys/kern/kern_mutex.c user/avg/xcpu/sys/kern/kern_rmlock.c user/avg/xcpu/sys/kern/kern_rwlock.c user/avg/xcpu/sys/kern/kern_sx.c user/avg/xcpu/sys/kern/kern_synch.c user/avg/xcpu/sys/sys/proc.h Modified: user/avg/xcpu/sys/kern/kern_mutex.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_mutex.c Wed May 18 15:07:36 2011 (r222059) +++ user/avg/xcpu/sys/kern/kern_mutex.c Wed May 18 15:08:30 2011 (r222060) @@ -348,7 +348,7 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t return; } - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; lock_profile_obtain_lock_failed(&m->lock_object, @@ -510,7 +510,7 @@ _mtx_lock_spin(struct mtx *m, uintptr_t uint64_t waittime = 0; #endif - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; if (LOCK_LOG_TEST(&m->lock_object, opts)) @@ -584,7 +584,7 @@ retry: break; } - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; lock_profile_obtain_lock_failed(&m->lock_object, @@ -673,7 +673,7 @@ _mtx_unlock_sleep(struct mtx *m, int opt return; } - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; /* Modified: user/avg/xcpu/sys/kern/kern_rmlock.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_rmlock.c Wed May 18 15:07:36 2011 (r222059) +++ user/avg/xcpu/sys/kern/kern_rmlock.c Wed May 18 15:08:30 2011 (r222060) @@ -279,7 +279,7 @@ _rm_rlock_hard(struct rmlock *rm, struct return (1); } - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return (1); /* @@ -388,7 +388,7 @@ _rm_unlock_hard(struct thread *td,struct if (!tracker->rmp_flags) return; - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; mtx_lock_spin(&rm_spinlock); @@ -442,7 +442,7 @@ _rm_wlock(struct rmlock *rm) else mtx_lock(&rm->rm_lock_mtx); - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; if (rm->rm_writecpus != all_cpus) { Modified: user/avg/xcpu/sys/kern/kern_rwlock.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_rwlock.c Wed May 18 15:07:36 2011 (r222059) +++ user/avg/xcpu/sys/kern/kern_rwlock.c Wed May 18 15:08:30 2011 (r222060) @@ -323,7 +323,7 @@ _rw_rlock(struct rwlock *rw, const char rw->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL); - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; for (;;) { @@ -535,7 +535,7 @@ _rw_runlock(struct rwlock *rw, const cha WITNESS_UNLOCK(&rw->lock_object, 0, file, line); LOCK_LOG_LOCK("RUNLOCK", &rw->lock_object, 0, 0, file, line); - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; /* TODO: drop "owner of record" here. */ @@ -665,7 +665,7 @@ _rw_wlock_hard(struct rwlock *rw, uintpt return; } - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; if (LOCK_LOG_TEST(&rw->lock_object, 0)) @@ -829,7 +829,7 @@ _rw_wunlock_hard(struct rwlock *rw, uint return; } - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; KASSERT(rw->rw_lock & (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS), Modified: user/avg/xcpu/sys/kern/kern_sx.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_sx.c Wed May 18 15:07:36 2011 (r222059) +++ user/avg/xcpu/sys/kern/kern_sx.c Wed May 18 15:08:30 2011 (r222060) @@ -493,7 +493,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t return (0); } - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return (0); if (LOCK_LOG_TEST(&sx->lock_object, 0)) @@ -695,7 +695,7 @@ _sx_xunlock_hard(struct sx *sx, uintptr_ return; } - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; MPASS(sx->sx_lock & (SX_LOCK_SHARED_WAITERS | @@ -760,7 +760,7 @@ _sx_slock_hard(struct sx *sx, int opts, int64_t sleep_time = 0; #endif - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return (0); /* @@ -929,7 +929,7 @@ _sx_sunlock_hard(struct sx *sx, const ch uintptr_t x; int wakeup_swapper; - if (THREAD_PANICKED()) + if (TD_IS_INPANIC()) return; for (;;) { Modified: user/avg/xcpu/sys/kern/kern_synch.c ============================================================================== --- user/avg/xcpu/sys/kern/kern_synch.c Wed May 18 15:07:36 2011 (r222059) +++ user/avg/xcpu/sys/kern/kern_synch.c Wed May 18 15:08:30 2011 (r222060) @@ -158,7 +158,7 @@ _sleep(void *ident, struct lock_object * else class = NULL; - if (cold || THREAD_PANICKED()) { + if (cold || TD_IS_INPANIC()) { /* * During autoconfiguration, just return; * don't run any other threads or panic below, @@ -260,7 +260,7 @@ msleep_spin(void *ident, struct mtx *mtx KASSERT(p != NULL, ("msleep1")); KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); - if (cold || THREAD_PANICKED()) { + if (cold || TD_IS_INPANIC()) { /* * During autoconfiguration, just return; * don't run any other threads or panic below, Modified: user/avg/xcpu/sys/sys/proc.h ============================================================================== --- user/avg/xcpu/sys/sys/proc.h Wed May 18 15:07:36 2011 (r222059) +++ user/avg/xcpu/sys/sys/proc.h Wed May 18 15:08:30 2011 (r222060) @@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC); * Otherwise, the kernel will deadlock since the scheduler isn't * going to run the thread that holds the lock we need. */ -#define THREAD_PANICED() \ +#define TD_IS_INPANIC() \ (panicstr != NULL && (curthread->td_flags & TDF_INPANIC) != 0) From owner-svn-src-user@FreeBSD.ORG Wed May 18 15:09:49 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F179106564A; Wed, 18 May 2011 15:09:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 401248FC1C; Wed, 18 May 2011 15:09:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IF9n64096926; Wed, 18 May 2011 15:09:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IF9nHg096924; Wed, 18 May 2011 15:09:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105181509.p4IF9nHg096924@svn.freebsd.org> From: Andriy Gapon Date: Wed, 18 May 2011 15:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222061 - user/avg/xcpu/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 15:09:49 -0000 Author: avg Date: Wed May 18 15:09:48 2011 New Revision: 222061 URL: http://svn.freebsd.org/changeset/base/222061 Log: smp rendezvous: remove unneeded memory barriers Modified: user/avg/xcpu/sys/kern/subr_smp.c Modified: user/avg/xcpu/sys/kern/subr_smp.c ============================================================================== --- user/avg/xcpu/sys/kern/subr_smp.c Wed May 18 15:08:30 2011 (r222060) +++ user/avg/xcpu/sys/kern/subr_smp.c Wed May 18 15:09:48 2011 (r222061) @@ -473,7 +473,7 @@ smp_rendezvous_wait(volatile struct smp_ ncpus = rv->smp_rv_ncpus; - while (atomic_load_acq_int(&rv->smp_rv_waiters) < ncpus) { + while (rv->smp_rv_waiters < ncpus) { /* check for incoming events */ if ((stopping_cpus & (1 << curcpu)) != 0) cpustop_handler(); @@ -549,7 +549,7 @@ smp_rendezvous_cpus_oneaction(cpumask_t } rv->smp_rv_action_func = action_func; - atomic_store_rel_int(&rv->smp_rv_waiters, 0); + rv->smp_rv_waiters = 0; tmp = map; while (tmp != 0) { From owner-svn-src-user@FreeBSD.ORG Wed May 18 18:42:59 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68944106566B; Wed, 18 May 2011 18:42:59 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 1746E8FC0C; Wed, 18 May 2011 18:42:58 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 853E545E86; Wed, 18 May 2011 20:25:07 +0200 (CEST) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id EB8E645685; Wed, 18 May 2011 20:25:01 +0200 (CEST) Date: Wed, 18 May 2011 20:24:41 +0200 From: Pawel Jakub Dawidek To: Andriy Gapon Message-ID: <20110518182441.GB2273@garage.freebsd.pl> References: <201105181508.p4IF8UoS096841@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz" Content-Disposition: inline In-Reply-To: <201105181508.p4IF8UoS096841@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r222060 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 18:42:59 -0000 --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 18, 2011 at 03:08:30PM +0000, Andriy Gapon wrote: [...] > --- user/avg/xcpu/sys/sys/proc.h Wed May 18 15:07:36 2011 (r222059) > +++ user/avg/xcpu/sys/sys/proc.h Wed May 18 15:08:30 2011 (r222060) > @@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC); > * Otherwise, the kernel will deadlock since the scheduler isn't > * going to run the thread that holds the lock we need. > */ > -#define THREAD_PANICED() \ > +#define TD_IS_INPANIC() \ > (panicstr !=3D NULL && (curthread->td_flags & TDF_INPANIC) !=3D 0) Does TDF_INPANIC make sense without panicstr being set? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --0eh6TmSyL6TZE2Uz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk3UDugACgkQForvXbEpPzRFeQCeJrx29VVJQEF7XDh0PvLt+peO Ra0AnR4UHiG8mHFzyT9g7iCV76bjVgE6 =Uggq -----END PGP SIGNATURE----- --0eh6TmSyL6TZE2Uz-- From owner-svn-src-user@FreeBSD.ORG Wed May 18 19:55:44 2011 Return-Path: Delivered-To: svn-src-user@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50DBF1065673; Wed, 18 May 2011 19:55:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 351A78FC08; Wed, 18 May 2011 19:55:42 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA27766; Wed, 18 May 2011 22:55:41 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QMmqL-000B3p-7l; Wed, 18 May 2011 22:55:41 +0300 Message-ID: <4DD4243C.4070301@FreeBSD.org> Date: Wed, 18 May 2011 22:55:40 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201105181508.p4IF8UoS096841@svn.freebsd.org> <20110518182441.GB2273@garage.freebsd.pl> In-Reply-To: <20110518182441.GB2273@garage.freebsd.pl> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-user@FreeBSD.org Subject: Re: svn commit: r222060 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 19:55:44 -0000 on 18/05/2011 21:24 Pawel Jakub Dawidek said the following: > On Wed, May 18, 2011 at 03:08:30PM +0000, Andriy Gapon wrote: > [...] >> --- user/avg/xcpu/sys/sys/proc.h Wed May 18 15:07:36 2011 (r222059) >> +++ user/avg/xcpu/sys/sys/proc.h Wed May 18 15:08:30 2011 (r222060) >> @@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC); >> * Otherwise, the kernel will deadlock since the scheduler isn't >> * going to run the thread that holds the lock we need. >> */ >> -#define THREAD_PANICED() \ >> +#define TD_IS_INPANIC() \ >> (panicstr != NULL && (curthread->td_flags & TDF_INPANIC) != 0) > > Does TDF_INPANIC make sense without panicstr being set? Very good observation. It seems that TDF_INPANIC can never be set unless panicstr is set. So, I guess it should be OK to simplify the macro further. Thank you. -- Andriy Gapon From owner-svn-src-user@FreeBSD.ORG Wed May 18 20:06:20 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A991106564A; Wed, 18 May 2011 20:06:20 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4EA8FC0C; Wed, 18 May 2011 20:06:19 +0000 (UTC) Received: by vws18 with SMTP id 18so1914059vws.13 for ; Wed, 18 May 2011 13:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=9UhxP7kwoZCV+h/+B6vw9SdW6urPCac3b+MOhh7AVv0=; b=DKlA1Z+uPwFKonzsCS3TkUd8gaUePbSy5xpjCVIUSQavxXxSBBii7583mrEJ3bd9v7 EOZFSLoz+VyTEJxmnQDlppfca0Goc4jdUUk2X15t9dukqJpKED36o4VzC8wo/fCocWmA 5LgRhbZnhi22TISsYqmM52hrvbmLRXxl7BMeA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Ld/vT9fBEK41LxBOv2qsykGLXdQOdjBqdLdXNUFC+FHU5FgbS7+qM+CMLGNjs9Nl3P pFkvdx/mek4686E2gE9N0i3BJmqHLFVwJ1w0x4glhC0aMOjbl1hFYPgIBw/3KiMARCHx ffsvGAP4ZUUdh0VEXSAdR769rFKqZIoBpKnHU= MIME-Version: 1.0 Received: by 10.220.190.67 with SMTP id dh3mr681298vcb.97.1305749178517; Wed, 18 May 2011 13:06:18 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.201.3 with HTTP; Wed, 18 May 2011 13:06:18 -0700 (PDT) In-Reply-To: <4DD4243C.4070301@FreeBSD.org> References: <201105181508.p4IF8UoS096841@svn.freebsd.org> <20110518182441.GB2273@garage.freebsd.pl> <4DD4243C.4070301@FreeBSD.org> Date: Wed, 18 May 2011 16:06:18 -0400 X-Google-Sender-Auth: on4g37tcIVtxS93Elv01SmgxGNE Message-ID: From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-user@freebsd.org Subject: Re: svn commit: r222060 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:06:20 -0000 2011/5/18 Andriy Gapon : > on 18/05/2011 21:24 Pawel Jakub Dawidek said the following: >> On Wed, May 18, 2011 at 03:08:30PM +0000, Andriy Gapon wrote: >> [...] >>> --- user/avg/xcpu/sys/sys/proc.h =C2=A0 =C2=A0 Wed May 18 15:07:36 2011= =C2=A0 =C2=A0 =C2=A0 =C2=A0(r222059) >>> +++ user/avg/xcpu/sys/sys/proc.h =C2=A0 =C2=A0 Wed May 18 15:08:30 2011= =C2=A0 =C2=A0 =C2=A0 =C2=A0(r222060) >>> @@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC); >>> =C2=A0 * Otherwise, the kernel will deadlock since the scheduler isn't >>> =C2=A0 * going to run the thread that holds the lock we need. >>> =C2=A0 */ >>> -#define =C2=A0 =C2=A0 THREAD_PANICED() =C2=A0 =C2=A0 =C2=A0 =C2=A0\ >>> +#define =C2=A0 =C2=A0 TD_IS_INPANIC() \ >>> =C2=A0 =C2=A0 =C2=A0(panicstr !=3D NULL && (curthread->td_flags & TDF_I= NPANIC) !=3D 0) >> >> Does TDF_INPANIC make sense without panicstr being set? > > Very good observation. =C2=A0It seems that TDF_INPANIC can never be set u= nless > panicstr is set. =C2=A0So, I guess it should be OK to simplify the macro = further. > Thank you. However I think that TDF_INPANIC handling is not optimal. You should really acquire thread_lock otherwise you are going to break choosethread() concurrency. I would prefer to make TDF_INPANIC a private flag and just use it with curthread, if possible, but I still don't have a good way to resolve choosethread() (I would dig the runqueue adding path and resolve the problem later in the codeflow, I think). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-user@FreeBSD.ORG Wed May 18 20:43:46 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F2B41065670; Wed, 18 May 2011 20:43:46 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 4F4EE8FC1B; Wed, 18 May 2011 20:43:44 +0000 (UTC) Received: by wwc33 with SMTP id 33so2106920wwc.31 for ; Wed, 18 May 2011 13:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fpZI/Y1l1nmex6CSZ28QioeZeD3DU0TB+8F8COVTOts=; b=xjEvGTujTosNktjqVkpFRtIMWFB9EWDQV0o0de8yCbUsIsSqwBdGv1lIAjphx3KhBz UQ/VPruuWigVJ26ERDQeWQ6hqUUL9VGJNvQjD00Lh/SC06dMptIM1nURKOFaVwfizPd1 rqpwODPutfPkMwkRB/hKJFkPzYghpT/6WZCjQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=DZ4B2nCWNRfkOs+Ei5qhT5VkvgPHEjZcOLxt6QgU1ejEgkR9ESTuYnZRYl7VoB/0Eq XlOWJq//5CGJ9pUZRREqHM0jZrqNqkjXkAY5SvttBSp+uqm+i6Sl10G3A3vijesoc+te XLVHQn3HNyOI0NufTMa8aCeSQKrhNu85Cv3kQ= MIME-Version: 1.0 Received: by 10.216.65.8 with SMTP id e8mr5063518wed.35.1305751423071; Wed, 18 May 2011 13:43:43 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.216.153.104 with HTTP; Wed, 18 May 2011 13:43:43 -0700 (PDT) In-Reply-To: References: <201105181508.p4IF8UoS096841@svn.freebsd.org> <20110518182441.GB2273@garage.freebsd.pl> <4DD4243C.4070301@FreeBSD.org> Date: Wed, 18 May 2011 13:43:43 -0700 X-Google-Sender-Auth: LxWv3dEWCdy2Y5sHwHkoESdEkok Message-ID: From: mdf@FreeBSD.org To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Andriy Gapon , svn-src-user@freebsd.org Subject: Re: svn commit: r222060 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:43:46 -0000 On Wed, May 18, 2011 at 1:06 PM, Attilio Rao wrote: > 2011/5/18 Andriy Gapon : >> on 18/05/2011 21:24 Pawel Jakub Dawidek said the following: >>> On Wed, May 18, 2011 at 03:08:30PM +0000, Andriy Gapon wrote: >>> [...] >>>> --- user/avg/xcpu/sys/sys/proc.h =A0 =A0 Wed May 18 15:07:36 2011 =A0 = =A0 =A0 =A0(r222059) >>>> +++ user/avg/xcpu/sys/sys/proc.h =A0 =A0 Wed May 18 15:08:30 2011 =A0 = =A0 =A0 =A0(r222060) >>>> @@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC); >>>> =A0 * Otherwise, the kernel will deadlock since the scheduler isn't >>>> =A0 * going to run the thread that holds the lock we need. >>>> =A0 */ >>>> -#define =A0 =A0 THREAD_PANICED() =A0 =A0 =A0 =A0\ >>>> +#define =A0 =A0 TD_IS_INPANIC() \ >>>> =A0 =A0 =A0(panicstr !=3D NULL && (curthread->td_flags & TDF_INPANIC) = !=3D 0) >>> >>> Does TDF_INPANIC make sense without panicstr being set? >> >> Very good observation. =A0It seems that TDF_INPANIC can never be set unl= ess >> panicstr is set. =A0So, I guess it should be OK to simplify the macro fu= rther. >> Thank you. > > However I think that TDF_INPANIC handling is not optimal. > You should really acquire thread_lock otherwise you are going to break > choosethread() concurrency. > > I would prefer to make TDF_INPANIC a private flag and just use it with > curthread, if possible, but I still don't have a good way to resolve > choosethread() (I would dig the runqueue adding path and resolve the > problem later in the codeflow, I think). I know it's almost required now (sync on reboot?!?!), but I would strongly question, from an architectural standpoint, why the scheduler should be running at all in panic. Once a thread pulls the panic trigger, nothing else should run except ddb in that thread's context. Cheers, matthew From owner-svn-src-user@FreeBSD.ORG Wed May 18 20:50:06 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89908106566C; Wed, 18 May 2011 20:50:06 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id C2C118FC0A; Wed, 18 May 2011 20:50:05 +0000 (UTC) Received: by vws18 with SMTP id 18so1957739vws.13 for ; Wed, 18 May 2011 13:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=vcK58+Y+qbAIIheYXBXGHrhsVjQkyhNRolsYhAHU1mc=; b=ES2kuAsXOg8W1TZYiGFz693WEi569zi1Zcxo+wQRYiEQEhbu5ySndMjMFHKU+qF41o +L5QJ7+qoOV5LmzuV5DvhwIidDh0ioR7eluweI2HL67Spha+n5yMX5pq/yubWIPhnNlK 1c7FLHkUIig+sZY3BAZcpMVtTc75L6V6F28EA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=L7Hoy1NqFTWsCe/9BIMtcy3bSKA40OeFnBQbb5Bkud5jL5xfZzBVqmQ7qTgKoo/iHd bUjJbhremHTxWJR+9FOI8jIERJ1KIQFeG15vzWyc91OCYuvzh79DdVN8Utybxs/edcNH ZaifLxULiVkI34g7KET8J3KSPF14wBwW7HT/8= MIME-Version: 1.0 Received: by 10.52.95.203 with SMTP id dm11mr3346933vdb.213.1305751804891; Wed, 18 May 2011 13:50:04 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.201.3 with HTTP; Wed, 18 May 2011 13:50:04 -0700 (PDT) In-Reply-To: References: <201105181508.p4IF8UoS096841@svn.freebsd.org> <20110518182441.GB2273@garage.freebsd.pl> <4DD4243C.4070301@FreeBSD.org> Date: Wed, 18 May 2011 16:50:04 -0400 X-Google-Sender-Auth: f5EM_A1hn1QAbt7oE0NrK8E6sUo Message-ID: From: Attilio Rao To: mdf@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Andriy Gapon , svn-src-user@freebsd.org Subject: Re: svn commit: r222060 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:50:06 -0000 2011/5/18 : > On Wed, May 18, 2011 at 1:06 PM, Attilio Rao wrote: >> 2011/5/18 Andriy Gapon : >>> on 18/05/2011 21:24 Pawel Jakub Dawidek said the following: >>>> On Wed, May 18, 2011 at 03:08:30PM +0000, Andriy Gapon wrote: >>>> [...] >>>>> --- user/avg/xcpu/sys/sys/proc.h =C2=A0 =C2=A0 Wed May 18 15:07:36 20= 11 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r222059) >>>>> +++ user/avg/xcpu/sys/sys/proc.h =C2=A0 =C2=A0 Wed May 18 15:08:30 20= 11 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r222060) >>>>> @@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC); >>>>> =C2=A0 * Otherwise, the kernel will deadlock since the scheduler isn'= t >>>>> =C2=A0 * going to run the thread that holds the lock we need. >>>>> =C2=A0 */ >>>>> -#define =C2=A0 =C2=A0 THREAD_PANICED() =C2=A0 =C2=A0 =C2=A0 =C2=A0\ >>>>> +#define =C2=A0 =C2=A0 TD_IS_INPANIC() \ >>>>> =C2=A0 =C2=A0 =C2=A0(panicstr !=3D NULL && (curthread->td_flags & TDF= _INPANIC) !=3D 0) >>>> >>>> Does TDF_INPANIC make sense without panicstr being set? >>> >>> Very good observation. =C2=A0It seems that TDF_INPANIC can never be set= unless >>> panicstr is set. =C2=A0So, I guess it should be OK to simplify the macr= o further. >>> Thank you. >> >> However I think that TDF_INPANIC handling is not optimal. >> You should really acquire thread_lock otherwise you are going to break >> choosethread() concurrency. >> >> I would prefer to make TDF_INPANIC a private flag and just use it with >> curthread, if possible, but I still don't have a good way to resolve >> choosethread() (I would dig the runqueue adding path and resolve the >> problem later in the codeflow, I think). > > I know it's almost required now (sync on reboot?!?!), but I would > strongly question, from an architectural standpoint, why the scheduler > should be running at all in panic. =C2=A0Once a thread pulls the panic > trigger, nothing else should run except ddb in that thread's context. Yes, I mostly agree, so for avg's purpose he should maybe assert choosethread() doesn't pickup the TDF_INPANIC threads (or just skip the check at all, as it should be made private). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-user@FreeBSD.ORG Thu May 19 16:32:40 2011 Return-Path: Delivered-To: svn-src-user@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45BE5106566B; Thu, 19 May 2011 16:32:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B2A4E8FC19; Thu, 19 May 2011 16:32:38 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA17276; Thu, 19 May 2011 19:32:37 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DD54624.5050202@FreeBSD.org> Date: Thu, 19 May 2011 19:32:36 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Attilio Rao References: <201105181508.p4IF8UoS096841@svn.freebsd.org> <20110518182441.GB2273@garage.freebsd.pl> <4DD4243C.4070301@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: mdf@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-user@FreeBSD.org Subject: Re: svn commit: r222060 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 16:32:40 -0000 on 18/05/2011 23:50 Attilio Rao said the following: > 2011/5/18 : >> On Wed, May 18, 2011 at 1:06 PM, Attilio Rao wrote: >>> 2011/5/18 Andriy Gapon : >>>> on 18/05/2011 21:24 Pawel Jakub Dawidek said the following: >>>>> On Wed, May 18, 2011 at 03:08:30PM +0000, Andriy Gapon wrote: >>>>> [...] >>>>>> --- user/avg/xcpu/sys/sys/proc.h Wed May 18 15:07:36 2011 (r222059) >>>>>> +++ user/avg/xcpu/sys/sys/proc.h Wed May 18 15:08:30 2011 (r222060) >>>>>> @@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC); >>>>>> * Otherwise, the kernel will deadlock since the scheduler isn't >>>>>> * going to run the thread that holds the lock we need. >>>>>> */ >>>>>> -#define THREAD_PANICED() \ >>>>>> +#define TD_IS_INPANIC() \ >>>>>> (panicstr != NULL && (curthread->td_flags & TDF_INPANIC) != 0) >>>>> >>>>> Does TDF_INPANIC make sense without panicstr being set? >>>> >>>> Very good observation. It seems that TDF_INPANIC can never be set unless >>>> panicstr is set. So, I guess it should be OK to simplify the macro further. >>>> Thank you. >>> >>> However I think that TDF_INPANIC handling is not optimal. >>> You should really acquire thread_lock otherwise you are going to break >>> choosethread() concurrency. >>> >>> I would prefer to make TDF_INPANIC a private flag and just use it with >>> curthread, if possible, but I still don't have a good way to resolve >>> choosethread() (I would dig the runqueue adding path and resolve the >>> problem later in the codeflow, I think). >> >> I know it's almost required now (sync on reboot?!?!), but I would >> strongly question, from an architectural standpoint, why the scheduler >> should be running at all in panic. Once a thread pulls the panic >> trigger, nothing else should run except ddb in that thread's context. This is true. The code that I propose makes sure that there is only one CPU and only one thread running when TDF_INPANIC is set. If someone decides to enable sync-on-panic and expect it to work, I can only pray for them. Yes, there most likely will be a knob to turn off CPU stopping for panic, but I plan it mostly as a quick way to switch back to legacy (present) behavior if a need arises (bugs, tec). It may work to the same degree as panic on SMP works now, but without any guarantees. > Yes, I mostly agree, so for avg's purpose he should maybe assert > choosethread() doesn't pickup the TDF_INPANIC threads (or just skip > the check at all, as it should be made private). Unfortunately I can not understand your concern and proposal. Not sure why choosethread() would be called at all, why it shouldn't pick up TDF_INPANIC thread(s), and which check could/should be skipped and what should be made private. Sorry :( -- Andriy Gapon