All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 10/24] kvm: Handle kvm_init_vcpu errors
From: Jan Kiszka @ 2011-02-01 21:15 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, qemu-devel
In-Reply-To: <cover.1296594961.git.jan.kiszka@web.de>

From: Jan Kiszka <jan.kiszka@siemens.com>

Do not ignore errors of kvm_init_vcpu, they are fatal.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 cpus.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/cpus.c b/cpus.c
index 312c7a2..8475757 100644
--- a/cpus.c
+++ b/cpus.c
@@ -273,12 +273,18 @@ void qemu_main_loop_start(void)
 void qemu_init_vcpu(void *_env)
 {
     CPUState *env = _env;
+    int r;
 
     env->nr_cores = smp_cores;
     env->nr_threads = smp_threads;
-    if (kvm_enabled())
-        kvm_init_vcpu(env);
-    return;
+
+    if (kvm_enabled()) {
+        r = kvm_init_vcpu(env);
+        if (r < 0) {
+            fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r));
+            exit(1);
+        }
+    }
 }
 
 int qemu_cpu_self(void *env)
@@ -604,11 +610,16 @@ static int qemu_cpu_exec(CPUState *env);
 static void *kvm_cpu_thread_fn(void *arg)
 {
     CPUState *env = arg;
+    int r;
 
     qemu_mutex_lock(&qemu_global_mutex);
     qemu_thread_self(env->thread);
 
-    kvm_init_vcpu(env);
+    r = kvm_init_vcpu(env);
+    if (r < 0) {
+        fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r));
+        exit(1);
+    }
 
     kvm_init_ipi(env);
 
-- 
1.7.1


^ permalink raw reply related

* [PATCH v2 12/24] Refactor signal setup functions in cpus.c
From: Jan Kiszka @ 2011-02-01 21:15 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, qemu-devel
In-Reply-To: <cover.1296594961.git.jan.kiszka@web.de>

From: Jan Kiszka <jan.kiszka@siemens.com>

Move {tcg,kvm}_init_ipi and block_io_signals to avoid prototypes, rename
the former two to clarify that they deal with more than SIG_IPI. No
functional changes - except for the tiny fixup of strerror usage.

The forward declaration of sigbus_handler is just temporarily, it will
be moved in a succeeding patch. dummy_signal is moved into the !_WIN32
block as we will soon need it also for !CONFIG_IOTHREAD.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 cpus.c |  162 +++++++++++++++++++++++++++++++++-------------------------------
 1 files changed, 83 insertions(+), 79 deletions(-)

diff --git a/cpus.c b/cpus.c
index 3a32828..42717ba 100644
--- a/cpus.c
+++ b/cpus.c
@@ -230,7 +230,15 @@ fail:
     close(fds[1]);
     return err;
 }
-#else
+
+#ifdef CONFIG_IOTHREAD
+static void dummy_signal(int sig)
+{
+}
+#endif
+
+#else /* _WIN32 */
+
 HANDLE qemu_event_handle;
 
 static void dummy_event_handler(void *opaque)
@@ -256,7 +264,7 @@ static void qemu_event_increment(void)
         exit (1);
     }
 }
-#endif
+#endif /* _WIN32 */
 
 #ifndef CONFIG_IOTHREAD
 int qemu_init_main_loop(void)
@@ -352,10 +360,6 @@ static QemuCond qemu_system_cond;
 static QemuCond qemu_pause_cond;
 static QemuCond qemu_work_cond;
 
-static void tcg_init_ipi(void);
-static void kvm_init_ipi(CPUState *env);
-static sigset_t block_io_signals(void);
-
 /* If we have signalfd, we mask out the signals we want to handle and then
  * use signalfd to listen for them.  We rely on whatever the current signal
  * handler is to dispatch the signals when we receive them.
@@ -391,6 +395,77 @@ static void sigfd_handler(void *opaque)
     }
 }
 
+static void cpu_signal(int sig)
+{
+    if (cpu_single_env) {
+        cpu_exit(cpu_single_env);
+    }
+    exit_request = 1;
+}
+
+static void qemu_kvm_init_cpu_signals(CPUState *env)
+{
+    int r;
+    sigset_t set;
+    struct sigaction sigact;
+
+    memset(&sigact, 0, sizeof(sigact));
+    sigact.sa_handler = dummy_signal;
+    sigaction(SIG_IPI, &sigact, NULL);
+
+    pthread_sigmask(SIG_BLOCK, NULL, &set);
+    sigdelset(&set, SIG_IPI);
+    sigdelset(&set, SIGBUS);
+    r = kvm_set_signal_mask(env, &set);
+    if (r) {
+        fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(-r));
+        exit(1);
+    }
+}
+
+static void qemu_tcg_init_cpu_signals(void)
+{
+    sigset_t set;
+    struct sigaction sigact;
+
+    memset(&sigact, 0, sizeof(sigact));
+    sigact.sa_handler = cpu_signal;
+    sigaction(SIG_IPI, &sigact, NULL);
+
+    sigemptyset(&set);
+    sigaddset(&set, SIG_IPI);
+    pthread_sigmask(SIG_UNBLOCK, &set, NULL);
+}
+
+static void sigbus_handler(int n, struct qemu_signalfd_siginfo *siginfo,
+                           void *ctx);
+
+static sigset_t block_io_signals(void)
+{
+    sigset_t set;
+    struct sigaction action;
+
+    /* SIGUSR2 used by posix-aio-compat.c */
+    sigemptyset(&set);
+    sigaddset(&set, SIGUSR2);
+    pthread_sigmask(SIG_UNBLOCK, &set, NULL);
+
+    sigemptyset(&set);
+    sigaddset(&set, SIGIO);
+    sigaddset(&set, SIGALRM);
+    sigaddset(&set, SIG_IPI);
+    sigaddset(&set, SIGBUS);
+    pthread_sigmask(SIG_BLOCK, &set, NULL);
+
+    memset(&action, 0, sizeof(action));
+    action.sa_flags = SA_SIGINFO;
+    action.sa_sigaction = (void (*)(int, siginfo_t*, void*))sigbus_handler;
+    sigaction(SIGBUS, &action, NULL);
+    prctl(PR_MCE_KILL, 1, 1, 0, 0);
+
+    return set;
+}
+
 static int qemu_signalfd_init(sigset_t mask)
 {
     int sigfd;
@@ -619,7 +694,7 @@ static void *kvm_cpu_thread_fn(void *arg)
         exit(1);
     }
 
-    kvm_init_ipi(env);
+    qemu_kvm_init_cpu_signals(env);
 
     /* signal CPU creation */
     env->created = 1;
@@ -642,7 +717,7 @@ static void *tcg_cpu_thread_fn(void *arg)
 {
     CPUState *env = arg;
 
-    tcg_init_ipi();
+    qemu_tcg_init_cpu_signals();
     qemu_thread_self(env->thread);
 
     /* signal CPU creation */
@@ -683,77 +758,6 @@ int qemu_cpu_self(void *_env)
     return qemu_thread_equal(&this, env->thread);
 }
 
-static void cpu_signal(int sig)
-{
-    if (cpu_single_env)
-        cpu_exit(cpu_single_env);
-    exit_request = 1;
-}
-
-static void tcg_init_ipi(void)
-{
-    sigset_t set;
-    struct sigaction sigact;
-
-    memset(&sigact, 0, sizeof(sigact));
-    sigact.sa_handler = cpu_signal;
-    sigaction(SIG_IPI, &sigact, NULL);
-
-    sigemptyset(&set);
-    sigaddset(&set, SIG_IPI);
-    pthread_sigmask(SIG_UNBLOCK, &set, NULL);
-}
-
-static void dummy_signal(int sig)
-{
-}
-
-static void kvm_init_ipi(CPUState *env)
-{
-    int r;
-    sigset_t set;
-    struct sigaction sigact;
-
-    memset(&sigact, 0, sizeof(sigact));
-    sigact.sa_handler = dummy_signal;
-    sigaction(SIG_IPI, &sigact, NULL);
-
-    pthread_sigmask(SIG_BLOCK, NULL, &set);
-    sigdelset(&set, SIG_IPI);
-    sigdelset(&set, SIGBUS);
-    r = kvm_set_signal_mask(env, &set);
-    if (r) {
-        fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(r));
-        exit(1);
-    }
-}
-
-static sigset_t block_io_signals(void)
-{
-    sigset_t set;
-    struct sigaction action;
-
-    /* SIGUSR2 used by posix-aio-compat.c */
-    sigemptyset(&set);
-    sigaddset(&set, SIGUSR2);
-    pthread_sigmask(SIG_UNBLOCK, &set, NULL);
-
-    sigemptyset(&set);
-    sigaddset(&set, SIGIO);
-    sigaddset(&set, SIGALRM);
-    sigaddset(&set, SIG_IPI);
-    sigaddset(&set, SIGBUS);
-    pthread_sigmask(SIG_BLOCK, &set, NULL);
-
-    memset(&action, 0, sizeof(action));
-    action.sa_flags = SA_SIGINFO;
-    action.sa_sigaction = (void (*)(int, siginfo_t*, void*))sigbus_handler;
-    sigaction(SIGBUS, &action, NULL);
-    prctl(PR_MCE_KILL, 1, 1, 0, 0);
-
-    return set;
-}
-
 void qemu_mutex_lock_iothread(void)
 {
     if (kvm_enabled()) {
-- 
1.7.1


^ permalink raw reply related

* [PATCH v2 03/24] Stop current VCPU on synchronous reset requests
From: Jan Kiszka @ 2011-02-01 21:15 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, qemu-devel
In-Reply-To: <cover.1296594961.git.jan.kiszka@web.de>

From: Jan Kiszka <jan.kiszka@siemens.com>

If some I/O operation ends up calling qemu_system_reset_request in VCPU
context, we record this and inform the io-thread, but we do not
terminate the VCPU loop. This can lead to fairly unexpected behavior if
the triggering reset operation is supposed to work synchronously.

Fix this for TCG (when run in deterministic I/O mode) by setting the
VCPU on stop and issuing a cpu_exit. KVM requires some more work on its
VCPU loop.

[ ported from qemu-kvm ]

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 cpus.c |   13 +++++++++----
 cpus.h |    1 +
 vl.c   |    1 +
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/cpus.c b/cpus.c
index ab6e40e..ceb3a83 100644
--- a/cpus.c
+++ b/cpus.c
@@ -99,6 +99,14 @@ void cpu_synchronize_all_post_init(void)
     }
 }
 
+void cpu_stop_current(void)
+{
+    if (cpu_single_env) {
+        cpu_single_env->stopped = 1;
+        cpu_exit(cpu_single_env);
+    }
+}
+
 int cpu_is_stopped(CPUState *env)
 {
     return !vm_running || env->stopped;
@@ -863,10 +871,7 @@ void vm_stop(int reason)
          * FIXME: should not return to device code in case
          * vm_stop() has been requested.
          */
-        if (cpu_single_env) {
-            cpu_exit(cpu_single_env);
-            cpu_single_env->stop = 1;
-        }
+        cpu_stop_current();
         return;
     }
     do_vm_stop(reason);
diff --git a/cpus.h b/cpus.h
index bf4d9bb..4cadb64 100644
--- a/cpus.h
+++ b/cpus.h
@@ -6,6 +6,7 @@ int qemu_init_main_loop(void);
 void qemu_main_loop_start(void);
 void resume_all_vcpus(void);
 void pause_all_vcpus(void);
+void cpu_stop_current(void);
 
 /* vl.c */
 extern int smp_cores;
diff --git a/vl.c b/vl.c
index 33f844f..db24a05 100644
--- a/vl.c
+++ b/vl.c
@@ -1278,6 +1278,7 @@ void qemu_system_reset_request(void)
     } else {
         reset_requested = 1;
     }
+    cpu_stop_current();
     qemu_notify_event();
 }
 
-- 
1.7.1


^ permalink raw reply related

* [PATCH v2 09/24] kvm: Drop redundant kvm_enabled from kvm_cpu_thread_fn
From: Jan Kiszka @ 2011-02-01 21:15 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, qemu-devel
In-Reply-To: <cover.1296594961.git.jan.kiszka@web.de>

From: Jan Kiszka <jan.kiszka@siemens.com>

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 cpus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpus.c b/cpus.c
index 5dfc54e..312c7a2 100644
--- a/cpus.c
+++ b/cpus.c
@@ -607,8 +607,8 @@ static void *kvm_cpu_thread_fn(void *arg)
 
     qemu_mutex_lock(&qemu_global_mutex);
     qemu_thread_self(env->thread);
-    if (kvm_enabled())
-        kvm_init_vcpu(env);
+
+    kvm_init_vcpu(env);
 
     kvm_init_ipi(env);
 
-- 
1.7.1


^ permalink raw reply related

* [PATCH v2 06/24] Leave inner main_loop faster on pending requests
From: Jan Kiszka @ 2011-02-01 21:15 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, qemu-devel
In-Reply-To: <cover.1296594961.git.jan.kiszka@web.de>

From: Jan Kiszka <jan.kiszka@siemens.com>

If there is any pending request that requires us to leave the inner loop
if main_loop, makes sure we do this as soon as possible by enforcing
non-blocking IO processing.

At this change, move variable definitions out of the inner loop to
improve readability.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 vl.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/vl.c b/vl.c
index 5fad700..2ebc55b 100644
--- a/vl.c
+++ b/vl.c
@@ -1384,18 +1384,21 @@ qemu_irq qemu_system_powerdown;
 
 static void main_loop(void)
 {
+    bool nonblocking = false;
+#ifdef CONFIG_PROFILER
+    int64_t ti;
+#endif
     int r;
 
     qemu_main_loop_start();
 
     for (;;) {
         do {
-            bool nonblocking = false;
-#ifdef CONFIG_PROFILER
-            int64_t ti;
-#endif
 #ifndef CONFIG_IOTHREAD
             nonblocking = cpu_exec_all();
+            if (!vm_can_run()) {
+                nonblocking = true;
+            }
 #endif
 #ifdef CONFIG_PROFILER
             ti = profile_getclock();
-- 
1.7.1


^ permalink raw reply related

* Re: [1.8.0] Change branch --set-uptream to take an argument
From: Junio C Hamano @ 2011-02-01 21:15 UTC (permalink / raw)
  To: Jay Soffian; +Cc: git
In-Reply-To: <AANLkTinUn2SMijphe3EmPMVOOwBjPB5ffFwwqZVxQmW0@mail.gmail.com>

Jay Soffian <jaysoffian@gmail.com> writes:

> Proposal:
>
> Currently it is very easy to misinvoke --set-upstream if you assume it
> takes an argument:
>
> e.g.
>
>   (master)$ git branch --set-upstream origin/master
>   Branch origin/master set up to track local branch master.

With "git branch <name>" (or for that matter "git branch -d <name>"), we
are manipulating some attribute of the branch <name> (namely, "what does
it point at", "does it exist?") not of the current branch.  So it is
natural to expect that some attribute of the named branch origin/master is
being changed.

> In order to make its usage unambiguous, and to allow it to be used w/o
> specifying the current branch, require it to take an argument like so:
>
>   (master)$ git branch --set-upstream=origin/master

Even though I think I understand the issue you are trying to tackle, I
think your proposal seems to make things worse.  In either "--set-upstream
A" or "--set-upstream=A", it is unclear if you are manipulating "what
other branch does this follow" attribute of A or the current branch.

I think it was a misdesign to allow --set-upstream without argument to
default to the current branch.  Wouldn't it be simpler to just fix the
parser so that "--set-upstream A" and "--set-upstream=A" both mean the
same thing?  The branch whose attribute is manipulated defaults to the
current one in either case.

IOW, I don't think

>   (master)$ git branch --set-upstream origin/master
>   Branch origin/master set up to track local branch master.

is a sane behaviour from day one, and is simply a bug.  Changing this
behaviour would merely be a bugfix, not a flag-day event that changes an
established behaviour.

But that may be just me.  I don't use --set-upstream myself, and people
may have learned to be comfortable with the current behaviour.

        If there are people who want to keep the current behaviour, please
        speak up.  Then we can introduce the usual migration procedure to
        first add a configuration to flip the behaviour (default off),
        then warn if you use 0-argument --set-upstream to default to the
        current branch without setting the configuration, and eventually
        flip the default to always require argument to --set-upstream.

> (I've misinvoked it so often, I've had to train myself to always
> invoke it this way: git branch master --set-upstream origin/master)

If "git branch master --set-upstream origin/master" is accepted, we have
another bug in its parser to fix.  The canonical command line should
always be dashed-options, then refs and then pathspecs.

^ permalink raw reply

* Re: [patch 11/28] posix-timers: Convert clock_settime to clockid_to_kclock()
From: john stultz @ 2011-02-01 21:15 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML, Richard Cochran, Ingo Molnar, Peter Zijlstra
In-Reply-To: <20110201134418.518851246@linutronix.de>

On Tue, 2011-02-01 at 13:51 +0000, Thomas Gleixner wrote:
> plain text document attachment (posix-timers-convert-clock-set.patch)
> Use the new kclock decoding function in clock_settime and cleanup all
> kclocks which use the default functions. Rename the misnomed
> common_clock_set() to posix_clock_realtime_set().
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Richard Cochran <richard.cochran@omicron.at>

Acked-by: John Stultz <johnstul@us.ibm.com>



^ permalink raw reply

* Re: [patch 08/28] posix-timers: Cleanup restart_block usage
From: Thomas Gleixner @ 2011-02-01 21:14 UTC (permalink / raw)
  To: john stultz; +Cc: LKML, Richard Cochran, Ingo Molnar, Peter Zijlstra
In-Reply-To: <1296594674.3336.51.camel@work-vm>

On Tue, 1 Feb 2011, john stultz wrote:
> On Tue, 2011-02-01 at 13:51 +0000, Thomas Gleixner wrote:
> > -		restart_block->fn = posix_cpu_nsleep_restart;
> > -		restart_block->arg0 = which_clock;
> > -		restart_block->arg1 = (unsigned long) rmtp;
> > -		restart_block->arg2 = t.tv_sec;
> > -		restart_block->arg3 = t.tv_nsec;
> > +		restart_block->nanosleep.expires = timespec_to_ns(&t);
> 
> The conversion back and forth from nanoseconds to timespec seems a
> little extraneous, but short of reworking all of the do_nanosleep calls
> to take a ktime I don't see a clean solution (since hrtimer also uses
> the restart_block).

We could simply add a timespec to the nanosleep struct in the
restart_block. Could be a union with expires.
 
Thanks,

	tglx

^ permalink raw reply

* Re: [patch 10/28] posix-cpu-timers: Remove the stub nanosleep functions
From: John Stultz @ 2011-02-01 21:14 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML, Richard Cochran, Ingo Molnar, Peter Zijlstra
In-Reply-To: <20110201134418.422446502@linutronix.de>

On Tue, 2011-02-01 at 13:51 +0000, Thomas Gleixner wrote:
> plain text document attachment
> (posix-cpu-timers-use-default-nsleep-notsup.patch)
> CLOCK_THREAD_CPUTIME_ID implements stub functions for nanosleep and
> nanosleep_restart, which return -EINVAL. That return value is
> wrong. The correct return value is -ENOTSUP.
> 
> Remove the stubs and let the new dispatch code return the correct
> error code.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Richard Cochran <richard.cochran@omicron.at>
> ---

Acked-by: John Stultz <johnstul@us.ibm.com>



^ permalink raw reply

* Re: [1.8.0] Change branch --set-uptream to take an argument
From: Jay Soffian @ 2011-02-01 21:14 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: Junio C Hamano, git
In-Reply-To: <vpqzkqg5dsq.fsf@bauges.imag.fr>

On Tue, Feb 1, 2011 at 4:01 AM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> Jay Soffian <jaysoffian@gmail.com> writes:
>
>> Currently it is very easy to misinvoke --set-upstream if you assume it
>> takes an argument:
>
> Your proposal sounds interesting, but I'd like to see something more
> global: right now, some commands take a --track option and other take
> a --set-upstream. In short, I'd like to see this --track deprecated
> (since it's not actually about remote-tracking ...).

There are a few things at work here. --track/--no-track are used to
override the branch.autosetupmerge configuration and are supported by
checkout and branch. --set-upstream is only supported by branch, and
is subtly different from --track.

There is also branch.autosetuprebase, for which there is no
command-line option to override.

These options/configs control how branch.<name>.{merge,remote,rebase}
are set. --track/--no-track only take effect when the branch is
created. --set-upstream can be used when the branch is created, or
after the fact.

(Aside, the names of the config params are starting to look
sub-optimal, but it's probably not worth the pain of changing them.)

I suppose a more comprehensive proposal looks like this:

1. Deprecate --track and --no-track (remove from documentation and
usage). I wonder if anyone ever uses them?

2. Deprecate --set-upstream as its usage is confusing.

3. Add -u <name> to both checkout and branch to specify the upstream
branch. It is used with checkout -b in cases where an upstream would
not normally be configured, either because it's not the default
according to branch.autosetupmerge or because the start-point is not a
branch. It is used with branch when creating a branch in a similar
manner to how it's used with checkout when creating a branch, but may
also be used to reset the upstream after the fact like so:

   $  git branch -u <upstream> [<branch>]

4. Add --pull-default={rebase,merge} to both checkout and branch used
for setting/unsetting branch.<name>.rebase during initial branch
creation, or after the fact in the case of git-branch. It is an error
to try to set --pull-default if the upstream is not configured, either
automatically or via -u.

>> (Though I'm not sure whether the options parser allows for both
>> --set-upstream and --set-upstream=<arg>)
>
> There are already many instances of this. When <arg> is mandatory, you
> can write either --option <arg> or --option=<arg> (like "git log
> --grep pattern" Vs "git log --grep=pattern"), and when <arg> is
> optional, you can write either --option alone, or --option=<arg> (like
> "git diff --color-words" and "git diff --color-words=.").

Sorry. What I meant was that you'd need the ability to differentiate
between "--set-upstream=foo" and "--set-upstream foo" due to
git-branch's existing semantics. Right now:

$ git branch --set-upstream topic origin/master

Creates topic from origin/master and sets topic's upstream to
origin/master. If --set-upstream suddenly starts taking an argument,
that means something completely different: create a new branch named
origin/master starting at HEAD and set its upstream to "topic".

I think we're better off just deprecating --set-upstream and
introducing the more convenient -u.

j.

^ permalink raw reply

* [PATCH 2/2] compat-wireless: backport of alloc_ordered_workqueue into compat.git
From: Hauke Mehrtens @ 2011-02-01 21:13 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless, Hauke Mehrtens
In-Reply-To: <1296594827-30742-1-git-send-email-hauke@hauke-m.de>

The backport of alloc_ordered_workqueue is now in compat.git.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/36-workqueue.patch |   15 ++-------------
 1 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/patches/36-workqueue.patch b/patches/36-workqueue.patch
index 06e580d..dfa6d8b 100644
--- a/patches/36-workqueue.patch
+++ b/patches/36-workqueue.patch
@@ -1,20 +1,9 @@
 Backport commit 99b88a0ecbdbc6df03527292571b2b442965814a
+The rest is backported in include/linux/compat-2.6.37.h
 
 --- a/net/mac80211/main.c
 +++ b/net/mac80211/main.c
-@@ -787,7 +787,11 @@ int ieee80211_register_hw(struct ieee802
- 		hw->queues = IEEE80211_MAX_QUEUES;
- 
- 	local->workqueue =
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
- 		alloc_ordered_workqueue(wiphy_name(local->hw.wiphy), 0);
-+#else
-+		create_singlethread_workqueue(wiphy_name(local->hw.wiphy));
-+#endif
- 	if (!local->workqueue) {
- 		result = -ENOMEM;
- 		goto fail_workqueue;
-@@ -1002,6 +1006,10 @@ static void __exit ieee80211_exit(void)
+@@ -1002,6 +1002,10 @@ static void __exit ieee80211_exit(void)
  	rc80211_minstrel_ht_exit();
  	rc80211_minstrel_exit();
  
-- 
1.7.1


^ permalink raw reply related

* [PATCH 1/2] compat-wireless: remove compat for threaded_irq in rt2x00
From: Hauke Mehrtens @ 2011-02-01 21:13 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless, Hauke Mehrtens

rt2x00 does not use threaded_irq any more.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/09-threaded-irq.patch |   56 -----------------------------------------
 1 files changed, 0 insertions(+), 56 deletions(-)

diff --git a/patches/09-threaded-irq.patch b/patches/09-threaded-irq.patch
index 059e58e..df164e9 100644
--- a/patches/09-threaded-irq.patch
+++ b/patches/09-threaded-irq.patch
@@ -61,59 +61,3 @@ thread in process context as well.
  };
  
  /* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */
---- a/drivers/net/wireless/rt2x00/rt2x00.h
-+++ b/drivers/net/wireless/rt2x00/rt2x00.h
-@@ -901,6 +901,10 @@ struct rt2x00_dev {
- 	 * Tasklet for processing tx status reports (rt2800pci).
- 	 */
- 	struct tasklet_struct txstatus_tasklet;
-+
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
-+	struct compat_threaded_irq irq_compat;
-+#endif
- };
- 
- /*
---- a/drivers/net/wireless/rt2x00/rt2x00pci.c
-+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
-@@ -160,10 +160,18 @@ int rt2x00pci_initialize(struct rt2x00_d
- 	/*
- 	 * Register interrupt handler.
- 	 */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
-+	status = compat_request_threaded_irq(&rt2x00dev->irq_compat,
-+					  rt2x00dev->irq,
-+					  rt2x00dev->ops->lib->irq_handler,
-+					  rt2x00dev->ops->lib->irq_handler_thread,
-+					  IRQF_SHARED, rt2x00dev->name, rt2x00dev);
-+#else
- 	status = request_threaded_irq(rt2x00dev->irq,
- 				      rt2x00dev->ops->lib->irq_handler,
- 				      rt2x00dev->ops->lib->irq_handler_thread,
- 				      IRQF_SHARED, rt2x00dev->name, rt2x00dev);
-+#endif
- 	if (status) {
- 		ERROR(rt2x00dev, "IRQ %d allocation failed (error %d).\n",
- 		      rt2x00dev->irq, status);
-@@ -187,7 +195,11 @@ void rt2x00pci_uninitialize(struct rt2x0
- 	/*
- 	 * Free irq line.
- 	 */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
-+	compat_free_threaded_irq(&rt2x00dev->irq_compat);
-+#else
- 	free_irq(rt2x00dev->irq, rt2x00dev);
-+#endif
- 
- 	/*
- 	 * Free DMA
-@@ -202,6 +214,9 @@ EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize
-  */
- static void rt2x00pci_free_reg(struct rt2x00_dev *rt2x00dev)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
-+	compat_destroy_threaded_irq(&rt2x00dev->irq_compat);
-+#endif
- 	kfree(rt2x00dev->rf);
- 	rt2x00dev->rf = NULL;
- 
-- 
1.7.1


^ permalink raw reply related

* [Cluster-devel] [patch] cman: Minor fixes for checkquorum script
From: Chris Feist @ 2011-02-01 21:13 UTC (permalink / raw)
  To: cluster-devel.redhat.com
In-Reply-To: <20110201210800.B834B120198@lists.fedorahosted.org>

cman: Minor fixes for checkquorum script

Remove all references to self-fencing
Removed absolute path the binaries in checkquorum
Added missing uninstall information for SHAREDIRTEX
---
 cman/scripts/checkquorum |   14 +++++++-------
 make/uninstall.mk        |    3 +++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/cman/scripts/checkquorum b/cman/scripts/checkquorum
index 43cbc6d..61934cd 100755
--- a/cman/scripts/checkquorum
+++ b/cman/scripts/checkquorum
@@ -26,14 +26,14 @@ if (($#ARGV != -1) && ($ARGV[0] eq "repair")) {
 
 if (!quorum()) {
   if (has_quorum_already_been_formed()) {
-    debug("Quorum has already existed, node can be self fenced!\n");
+    debug("Quorum has already existed, node can be rebooted!\n");
     if (-e $timerfile) {
        $tf = open (FILE, "$timerfile");
        $time = <FILE>;
        close (FILE);
        $timediff = time() - $time;
        if ($timediff >= $wait_time) {
-	 self_fence()
+	 reboot()
        } else {
          $remaining = $wait_time - $timediff;
          debug("Time has not exceeded wait time ($remaining seconds remaining).\n");
@@ -45,16 +45,16 @@ if (!quorum()) {
        close (FILE);
     }
   } else {
-    debug("This is a new startup no self-fencing will occur.\n");
+    debug("This is a new startup no reboot will occur.\n");
     `rm -f $timerfile`;
   }
 } else {
-  debug("Quorum exists, no self-fencing should occur.\n");
+  debug("Quorum exists, no reboot should occur.\n");
   `rm -f $timerfile`;
 }
 
 sub has_quorum_already_been_formed {
-   $oe = `/usr/sbin/corosync-objctl 2>&1 | grep -E "runtime.totem.pg.mrp.srp.operational_entered|Could not initialize objdb library|Cannot connect to quorum service" `;
+   $oe = `corosync-objctl 2>&1 | grep -E "runtime.totem.pg.mrp.srp.operational_entered|Could not initialize objdb library|Cannot connect to quorum service" `;
    if ($oe =~ /^Could not/ || $oe =~ /^Cannot/) {
 	debug("corosync is not running\n");
 	exit 0;
@@ -79,8 +79,8 @@ sub quorum {
   return 0;
 }
 
-sub self_fence {
-  debug("Self fencing commencing...\n");
+sub reboot {
+  debug("Reboot commencing...\n");
   `rm -f $timerfile`;
   if ($hardreboot == 1) {
     `echo 1 > /proc/sys/kernel/sysrq`;
diff --git a/make/uninstall.mk b/make/uninstall.mk
index 8440187..01e8d2d 100644
--- a/make/uninstall.mk
+++ b/make/uninstall.mk
@@ -38,6 +38,9 @@ endif
 ifdef PKGCONF
 	${UNINSTALL} ${PKGCONF} ${pkgconfigdir}
 endif
+ifdef SHAREDIRTEX
+	${UNINSTALL} ${SHAREDIRTEX} ${sharedir}
+endif
 ifdef SHAREDIRT
 	${UNINSTALL} ${SHAREDIRT} ${sharedir}
 endif



^ permalink raw reply related

* [Cluster-devel] [patch] cman: Added checkquorum script for self fencing
From: Chris Feist @ 2011-02-01 21:13 UTC (permalink / raw)
  To: cluster-devel.redhat.com
In-Reply-To: <20110201202222.34399120198@lists.fedorahosted.org>

cman: Added checkquorum script for self fencing

A checkquorum script has been added which when copied to the
/etc/watchdog.d directory will cause the machine to node to reboot
itself if it has lost quorum for ~60 seconds.

Resolves: rhbz#560700
---
 cman/Makefile            |    2 +-
 cman/man/Makefile        |    3 +-
 cman/man/checkquorum.8   |   29 ++++++++++++++
 cman/scripts/Makefile    |   10 +++++
 cman/scripts/checkquorum |   97 ++++++++++++++++++++++++++++++++++++++++++++++
 make/install.mk          |    4 ++
 6 files changed, 143 insertions(+), 2 deletions(-)

diff --git a/cman/Makefile b/cman/Makefile
index ead0baa..1cf8bc9 100644
--- a/cman/Makefile
+++ b/cman/Makefile
@@ -1,4 +1,4 @@
 include ../make/defines.mk
 include $(OBJDIR)/make/passthrough.mk
 
-SUBDIRS=lib cman_tool daemon qdisk notifyd init.d man
+SUBDIRS=lib cman_tool daemon qdisk notifyd init.d man scripts
diff --git a/cman/man/Makefile b/cman/man/Makefile
index df20abb..f7fbebf 100644
--- a/cman/man/Makefile
+++ b/cman/man/Makefile
@@ -5,7 +5,8 @@ MANTARGET= \
 	qdiskd.8 \
 	mkqdisk.8 \
 	cmannotifyd.8 \
-	cman_notify.8
+	cman_notify.8 \
+	checkquorum.8
 
 include ../../make/defines.mk
 include $(OBJDIR)/make/install.mk
diff --git a/cman/man/checkquorum.8 b/cman/man/checkquorum.8
new file mode 100644
index 0000000..96f61f0
--- /dev/null
+++ b/cman/man/checkquorum.8
@@ -0,0 +1,29 @@
+.TH "checkquorum" "8" "February 2011" "" "Check Quorum Watchdog Script"
+.SH "NAME"
+checkquorum \- Check Quorum Watchdog Script
+.SH "SYNOPSIS"
+\fBcheckquorum
+.SH "DESCRIPTION"
+.PP 
+The \fBcheckquorum\fP watchdog script, when copied to the
+.IR /etc/watchdog.d
+directory and after enabling/starting the watchdog daemon causes the node to reboot if quorum is
+lost and not regained within a user configurable amount of time (default: 60 seconds).
+.SH "OPTIONS"
+The checkquorum script includes several options which can be set by editing
+the script with a text editor.
+.TP
+.BR $wait_time
+Amount of time in seconds to wait after quorum is lost before trigger a reboot
+(Default: 60 seconds).
+.TP
+.BR $hardreboot
+Instantly reboot the machine without cleanly shutting down the system.
+Useful when the machine may hang on reboot.  Set to 1 to hard reboot the
+system, 0 to do a normal reboot.
+.SH "NOTES"
+\fBcheckquorum\fP should never be called outside of watchdog except for
+debugging purposes.
+
+.SH "SEE ALSO"
+watchdog(8)
diff --git a/cman/scripts/Makefile b/cman/scripts/Makefile
new file mode 100644
index 0000000..b4866c8
--- /dev/null
+++ b/cman/scripts/Makefile
@@ -0,0 +1,10 @@
+SHAREDIRTEX=checkquorum
+
+include ../../make/defines.mk
+include $(OBJDIR)/make/clean.mk
+include $(OBJDIR)/make/install.mk
+include $(OBJDIR)/make/uninstall.mk
+
+all:
+
+clean: generalclean
diff --git a/cman/scripts/checkquorum b/cman/scripts/checkquorum
new file mode 100755
index 0000000..43cbc6d
--- /dev/null
+++ b/cman/scripts/checkquorum
@@ -0,0 +1,97 @@
+#!/usr/bin/perl -w
+# Quorum detection watchdog script
+#
+# This script will return -2 if the node had quorum at one point
+# and then subsequently lost it
+#
+# Copyright 2011 Red Hat, Inc.
+
+# Amount of time in seconds to wait after quorum is lost to fail script
+$wait_time = 60;
+
+# Hard Reboot the system (doesn't cleanly shut down the system)
+$hardreboot = 0;
+
+# Location of temporary file to capture timeouts
+$timerfile = "/var/run/cluster/checkquorum-timer";
+
+# Enable debug messages (0 to disable, 1 to enable)
+$debugval = 0;
+
+# If command is called attempting to 'repair' we automatically fail
+if (($#ARGV != -1) && ($ARGV[0] eq "repair")) {
+  debug ("Failing on repair\n");
+  exit 1;
+}
+
+if (!quorum()) {
+  if (has_quorum_already_been_formed()) {
+    debug("Quorum has already existed, node can be self fenced!\n");
+    if (-e $timerfile) {
+       $tf = open (FILE, "$timerfile");
+       $time = <FILE>;
+       close (FILE);
+       $timediff = time() - $time;
+       if ($timediff >= $wait_time) {
+	 self_fence()
+       } else {
+         $remaining = $wait_time - $timediff;
+         debug("Time has not exceeded wait time ($remaining seconds remaining).\n");
+       }
+    } else {
+      debug("Creating timer file...\n");
+       $tf = open (FILE, ">$timerfile");
+       print FILE time();
+       close (FILE);
+    }
+  } else {
+    debug("This is a new startup no self-fencing will occur.\n");
+    `rm -f $timerfile`;
+  }
+} else {
+  debug("Quorum exists, no self-fencing should occur.\n");
+  `rm -f $timerfile`;
+}
+
+sub has_quorum_already_been_formed {
+   $oe = `/usr/sbin/corosync-objctl 2>&1 | grep -E "runtime.totem.pg.mrp.srp.operational_entered|Could not initialize objdb library|Cannot connect to quorum service" `;
+   if ($oe =~ /^Could not/ || $oe =~ /^Cannot/) {
+	debug("corosync is not running\n");
+	exit 0;
+   }
+   $oe =~ s/.*=//;
+   if ($oe > 1) {
+	return 1;
+   } else {
+	return 0;
+   }
+}
+
+sub quorum {
+  $cq = `corosync-quorumtool -s 2>&1 | grep -E "Quorate:|Cannot connect to quorum service"`;
+  if ($cq =~ /Cannot connect to quorum service/) {
+    debug("corosync is not running\n");
+    exit 0;
+  }
+  $cq =~ s/Quorate: *//;
+  chomp ($cq);
+  return 1 if ($cq eq "Yes");
+  return 0;
+}
+
+sub self_fence {
+  debug("Self fencing commencing...\n");
+  `rm -f $timerfile`;
+  if ($hardreboot == 1) {
+    `echo 1 > /proc/sys/kernel/sysrq`;
+    `echo b > /proc/sysrq-trigger`;
+  }
+  exit -2;
+}
+
+sub debug {
+  $out = pop(@_);
+  if ($debugval) {
+    print $out;
+  }
+}
diff --git a/make/install.mk b/make/install.mk
index 3f23bca..fa6ac92 100644
--- a/make/install.mk
+++ b/make/install.mk
@@ -66,6 +66,10 @@ ifdef PKGCONF
 	install -d ${pkgconfigdir}
 	install -m644 ${PKGCONF} ${pkgconfigdir}
 endif
+ifdef SHAREDIRTEX
+	install -d ${sharedir}
+	install -m755 ${SHAREDIRTEX} ${sharedir}
+endif
 ifdef SHAREDIRT
 	install -d ${sharedir}
 	install -m644 ${SHAREDIRT} ${sharedir}



^ permalink raw reply related

* [PATCH] drm/radeon/kms: rv6xx+ thermal sensor fixes
From: Alex Deucher @ 2011-02-01 21:12 UTC (permalink / raw)
  To: airlied, dri-devel

Some fixes to the thermal sensor code:
- handle negative numbers
- properly handle temp calculation on different asics

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
---
 drivers/gpu/drm/radeon/evergreen.c |   21 ++++++++++++---------
 drivers/gpu/drm/radeon/r600.c      |    8 ++++++--
 drivers/gpu/drm/radeon/radeon.h    |    8 ++++----
 drivers/gpu/drm/radeon/radeon_pm.c |    2 +-
 drivers/gpu/drm/radeon/rv770.c     |   19 ++++++++++++-------
 5 files changed, 35 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index c0ca7dd..0352cd2 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -97,26 +97,29 @@ u32 evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
 }
 
 /* get temperature in millidegrees */
-u32 evergreen_get_temp(struct radeon_device *rdev)
+int evergreen_get_temp(struct radeon_device *rdev)
 {
 	u32 temp = (RREG32(CG_MULT_THERMAL_STATUS) & ASIC_T_MASK) >>
 		ASIC_T_SHIFT;
 	u32 actual_temp = 0;
 
-	if ((temp >> 10) & 1)
-		actual_temp = 0;
-	else if ((temp >> 9) & 1)
+	if (temp & 0x400)
+		actual_temp = -256;
+	else if (temp & 0x200)
 		actual_temp = 255;
-	else
-		actual_temp = (temp >> 1) & 0xff;
+	else if (temp & 0x100) {
+		actual_temp = temp & 0x1ff;
+		actual_temp |= ~0x1ff;
+	} else
+		actual_temp = temp & 0xff;
 
-	return actual_temp * 1000;
+	return (actual_temp * 1000) / 2;
 }
 
-u32 sumo_get_temp(struct radeon_device *rdev)
+int sumo_get_temp(struct radeon_device *rdev)
 {
 	u32 temp = RREG32(CG_THERMAL_STATUS) & 0xff;
-	u32 actual_temp = (temp >> 1) & 0xff;
+	int actual_temp = temp - 49;
 
 	return actual_temp * 1000;
 }
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index f574d9b..c6a580b 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -98,12 +98,16 @@ void r600_irq_disable(struct radeon_device *rdev);
 static void r600_pcie_gen2_enable(struct radeon_device *rdev);
 
 /* get temperature in millidegrees */
-u32 rv6xx_get_temp(struct radeon_device *rdev)
+int rv6xx_get_temp(struct radeon_device *rdev)
 {
 	u32 temp = (RREG32(CG_THERMAL_STATUS) & ASIC_T_MASK) >>
 		ASIC_T_SHIFT;
+	int actual_temp = temp & 0xff;
 
-	return temp * 1000;
+	if (temp & 0x100)
+		actual_temp -= 256;
+
+	return actual_temp * 1000;
 }
 
 void r600_pm_get_dynpm_state(struct radeon_device *rdev)
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 854ddc6..49a6890 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -179,10 +179,10 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev);
 void radeon_atombios_get_power_modes(struct radeon_device *rdev);
 void radeon_atom_set_voltage(struct radeon_device *rdev, u16 level);
 void rs690_pm_info(struct radeon_device *rdev);
-extern u32 rv6xx_get_temp(struct radeon_device *rdev);
-extern u32 rv770_get_temp(struct radeon_device *rdev);
-extern u32 evergreen_get_temp(struct radeon_device *rdev);
-extern u32 sumo_get_temp(struct radeon_device *rdev);
+extern int rv6xx_get_temp(struct radeon_device *rdev);
+extern int rv770_get_temp(struct radeon_device *rdev);
+extern int evergreen_get_temp(struct radeon_device *rdev);
+extern int sumo_get_temp(struct radeon_device *rdev);
 
 /*
  * Fences.
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 3b1b2bf..8136200 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -430,7 +430,7 @@ static ssize_t radeon_hwmon_show_temp(struct device *dev,
 {
 	struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
 	struct radeon_device *rdev = ddev->dev_private;
-	u32 temp;
+	int temp;
 
 	switch (rdev->pm.int_thermal_type) {
 	case THERMAL_TYPE_RV6XX:
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 491dc90..2211a32 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -78,18 +78,23 @@ u32 rv770_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
 }
 
 /* get temperature in millidegrees */
-u32 rv770_get_temp(struct radeon_device *rdev)
+int rv770_get_temp(struct radeon_device *rdev)
 {
 	u32 temp = (RREG32(CG_MULT_THERMAL_STATUS) & ASIC_T_MASK) >>
 		ASIC_T_SHIFT;
-	u32 actual_temp = 0;
-
-	if ((temp >> 9) & 1)
-		actual_temp = 0;
-	else
-		actual_temp = (temp >> 1) & 0xff;
-
-	return actual_temp * 1000;
+	int actual_temp;
+
+	if (temp & 0x400)
+		actual_temp = -256;
+	else if (temp & 0x200)
+		actual_temp = 255;
+	else if (temp & 0x100) {
+		actual_temp = temp & 0x1ff;
+		actual_temp |= ~0x1ff;
+	} else
+		actual_temp = temp & 0xff;
+
+	return (actual_temp * 1000) / 2;
 }
 
 void rv770_pm_misc(struct radeon_device *rdev)
-- 
1.7.1.1

^ permalink raw reply related

* Re: [patch] xfsprogs: repair never return if device removed
From: Christoph Hellwig @ 2011-02-01 21:14 UTC (permalink / raw)
  To: Ajeet Yadav; +Cc: xfs
In-Reply-To: <AANLkTikyOfkbtxN3Et5YZRJ2rPpdsVouJkyRW4fDbUG7@mail.gmail.com>

On Mon, Jan 31, 2011 at 11:41:16AM +0900, Ajeet Yadav wrote:
> I did not receive and response / reviews on patch.

The patch looks good, but we'll need a Signed-off-by line to
apply it.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply

* Re: [patch 09/28] thread_info: Remove legacy arg0-3 from restart_block
From: john stultz @ 2011-02-01 21:11 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML, Richard Cochran, Ingo Molnar, Peter Zijlstra
In-Reply-To: <20110201134418.326209775@linutronix.de>

On Tue, 2011-02-01 at 13:51 +0000, Thomas Gleixner wrote:
> plain text document attachment (thread-info-remove-arg0-3.patch)
> posix timers were the last users of the legacy arg0-3 members of
> restart_block. Remove the cruft.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Richard Cochran <richard.cochran@omicron.at>
> ---

Acked-by: John Stultz <johnstul@us.ibm.com>




^ permalink raw reply

* Re: [patch 08/28] posix-timers: Cleanup restart_block usage
From: john stultz @ 2011-02-01 21:11 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML, Richard Cochran, Ingo Molnar, Peter Zijlstra
In-Reply-To: <20110201134418.232288779@linutronix.de>

On Tue, 2011-02-01 at 13:51 +0000, Thomas Gleixner wrote:
> plain text document attachment
> (posix-timers-cleanup-restart-block.patch)
> posix timers still use the legacy arg0-arg3 members of
> restart_block. Use restart_block.nanosleep instead
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Richard Cochran <richard.cochran@omicron.at>
[snip]
>  long posix_cpu_nsleep_restart(struct restart_block *restart_block)
>  {
> -	clockid_t which_clock = restart_block->arg0;
> -	struct timespec __user *rmtp;
> +	clockid_t which_clock = restart_block->nanosleep.index;
>  	struct timespec t;
>  	struct itimerspec it;
>  	int error;
> 
> -	rmtp = (struct timespec __user *) restart_block->arg1;
> -	t.tv_sec = restart_block->arg2;
> -	t.tv_nsec = restart_block->arg3;
> +	t = ns_to_timespec(restart_block->nanosleep.expires);
> 
> -	restart_block->fn = do_no_restart_syscall;
>  	error = do_cpu_nanosleep(which_clock, TIMER_ABSTIME, &t, &it);
> 
>  	if (error == -ERESTART_RESTARTBLOCK) {
> +		struct timespec __user *rmtp = restart_block->nanosleep.rmtp;
>  		/*
> -	 	 * Report back to the user the time still remaining.
> -	 	 */
> -		if (rmtp != NULL && copy_to_user(rmtp, &it.it_value, sizeof *rmtp))
> +		 * Report back to the user the time still remaining.
> +		 */
> +		if (rmtp && copy_to_user(rmtp, &it.it_value, sizeof *rmtp))
>  			return -EFAULT;
> 
> -		restart_block->fn = posix_cpu_nsleep_restart;
> -		restart_block->arg0 = which_clock;
> -		restart_block->arg1 = (unsigned long) rmtp;
> -		restart_block->arg2 = t.tv_sec;
> -		restart_block->arg3 = t.tv_nsec;
> +		restart_block->nanosleep.expires = timespec_to_ns(&t);

The conversion back and forth from nanoseconds to timespec seems a
little extraneous, but short of reworking all of the do_nanosleep calls
to take a ktime I don't see a clean solution (since hrtimer also uses
the restart_block).

Acked-by: John Stultz <johnstul@us.ibm.com>

thanks
-john


^ permalink raw reply

* Re: [1.8.0] make two-argument fetch update remote branches
From: A Large Angry SCM @ 2011-02-01 21:05 UTC (permalink / raw)
  To: Thomas Rast; +Cc: Junio C Hamano, git
In-Reply-To: <201101312244.10047.trast@student.ethz.ch>

On 01/31/2011 04:44 PM, Thomas Rast wrote:
> Proposal:
>
> Running "git fetch origin master" only updates FETCH_HEAD, not
> origin/master, which turns out to be quite confusing for newcomers
> especially after running 'git pull origin master'.
>
> Since the remote branches in some sense reflect the "last known state"
> of the remote, it would make sense to also update them to whatever a
> two-argument fetch got.
>

If this is proposing to break:

	get-fetch ${REPO} ${SRC_REF}:${DST_REF}

then I am against this since that form _is_ used and *is* plumbing.

^ permalink raw reply

* Re: pull request: wireless-2.6 2011-02-01
From: David Miller @ 2011-02-01 21:10 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20110201204010.GG2560@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Tue, 1 Feb 2011 15:40:10 -0500

> git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master

Pulled, thanks JOhn.

^ permalink raw reply

* Re: Network performance with small packets
From: Shirley Ma @ 2011-02-01 21:09 UTC (permalink / raw)
  To: Sridhar Samudrala
  Cc: Steve Dobbelstein, Michael S. Tsirkin, David Miller, kvm,
	mashirle, netdev
In-Reply-To: <1296523838.30191.39.camel@sridhar.beaverton.ibm.com>

On Mon, 2011-01-31 at 17:30 -0800, Sridhar Samudrala wrote:
> Yes. It definitely should be 'out'. 'in' should be 0 in the tx path.
> 
> I tried a simpler version of this patch without any tunables by
> delaying the signaling until we come out of the for loop.
> It definitely reduced the number of vmexits significantly for small
> message
> guest to host stream test and the throughput went up a little.
> 
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 9b3ca10..5f9fae9 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -197,7 +197,7 @@ static void handle_tx(struct vhost_net *net)
>                 if (err != len)
>                         pr_debug("Truncated TX packet: "
>                                  " len %d != %zd\n", err, len);
> -               vhost_add_used_and_signal(&net->dev, vq, head, 0);
> +               vhost_add_used(vq, head, 0);
>                 total_len += len;
>                 if (unlikely(total_len >= VHOST_NET_WEIGHT)) {
>                         vhost_poll_queue(&vq->poll);
> @@ -205,6 +205,8 @@ static void handle_tx(struct vhost_net *net)
>                 }
>         }
> 
> +       if (total_len > 0)
> +               vhost_signal(&net->dev, vq);
>         mutex_unlock(&vq->mutex);
>  }

Reducing the signaling will reduce the CPU utilization by reducing VM
exits. 

The small message BW is a problem we have seen faster guest/slow vhost,
even I increased VHOST_NET_WEIGHT times, it didn't help that much for
BW. For large message size, vhost is able to process all packets on
time. I played around with guest/host codes, I only see huge BW
improvement by dropping packets on guest side so far.

Thanks
Shirley


^ permalink raw reply

* Re: Early crash (was: Re: module: show version information for built-in modules in sysfs)
From: Dmitry Torokhov @ 2011-02-01 21:09 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rusty Russell, linux-kernel@vger.kernel.org, Linux/m68k
In-Reply-To: <AANLkTin4gOnEMruLDM=TkNYsNf5S370WqbcDVJzT7_Z4@mail.gmail.com>

On Tue, Feb 01, 2011 at 12:33:29PM -0800, Geert Uytterhoeven wrote:
> On Mon, Jan 24, 2011 at 11:59, Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org> wrote:
> > Gitweb:     http://git.kernel.org/linus/e94965ed5beb23c6fabf7ed31f625e66d7ff28de
> 
> >    module: show version information for built-in modules in sysfs
> >
> >    Currently only drivers that are built as modules have their versions
> >    shown in /sys/module/<module_name>/version, but this information might
> >    also be useful for built-in drivers as well. This especially important
> >    for drivers that do not define any parameters - such drivers, if
> >    built-in, are completely invisible from userspace.
> >
> >    This patch changes MODULE_VERSION() macro so that in case when we are
> >    compiling built-in module, version information is stored in a separate
> >    section. Kernel then uses this data to create 'version' sysfs attribute
> >    in the same fashion it creates attributes for module parameters.
> 
> This commit causes the crash below on m68k (ARAnyM).
> Reverting this commit and its dependency
> 3b90a5b292321b2acac3921f77046ae195aef53f
> ("module: fix linker error for MODULE_VERSION when !MODULE and CONFIG_SYSFS=n")
> makes it boot again.
> 

Hi Geert,

Does the follwing help by any chance?

>From d6fd4a6e0fc2d3f0a74962d4a6f663a46d230ecd Mon Sep 17 00:00:00 2001
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index ef33213..47e15eb 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -141,6 +141,12 @@ SECTIONS {
 		*(__param)
 		__stop___param = .;
 
+		/* Built-in module versions */
+		. = ALIGN(4) ;
+		__start___modver = .;
+		*(__modver)
+		__stop___modver = .;
+
 		. = ALIGN(4) ;
 		_etext = . ;
 	} > TEXT

Thanks,

Dmitry


^ permalink raw reply related

* Re: Ralink RT2501/RT2573 USB Wireless Adapter crashes kernel 2.6.37
From: Johannes Stezenbach @ 2011-02-01 21:09 UTC (permalink / raw)
  To: Eric Fernandez; +Cc: linux-wireless
In-Reply-To: <AANLkTi=VGu6Ysn5WkYjdmVx1+gvzywmqA1-jG5DEL3Eh@mail.gmail.com>

On Tue, Feb 01, 2011 at 08:31:33PM +0000, Eric Fernandez wrote:
> Feb  1 20:22:39 localhost kernel: PGD 154c063 PUD 1fffc067 PMD 80000000c94001e3
> Feb  1 20:22:39 localhost kernel: CPU 1
> Feb  1 20:22:39 localhost kernel: Modules linked in: rt73usb(+)
> rt2500usb rt2x00usb rt2x00lib mac80211 cfg80211 rfkill ipv6 it87
> adt7475 hwmon_vid ext3 jbd nls_cp437 vfat fat joydev usbhid hid
> nvidia(P) uvcvideo videodev v4l1_compat v4l2_compat_ioctl32
...
> Feb  1 20:22:39 localhost kernel: Pid: 7507, comm: modprobe Tainted: P

proprietary modules :-(

> Feb  1 20:22:39 localhost kernel: [<ffffffff812ae58a>] device_add+0x4fa/0x5c0
> Feb  1 20:22:39 localhost kernel: [<ffffffffa00846af>]
> rfkill_register+0x9f/0x270 [rfkill]
> Feb  1 20:22:39 localhost kernel: [<ffffffffa0cdf096>]
> wiphy_register+0x246/0x340 [cfg80211]
> Feb  1 20:22:39 localhost kernel: [<ffffffff81127e2b>] ? __kmalloc+0x19b/0x280
> Feb  1 20:22:39 localhost kernel: [<ffffffffa0d032e7>]
> ieee80211_register_hw+0x167/0x520 [mac80211]
> Feb  1 20:22:39 localhost kernel: [<ffffffffa0d43e40>]
> rt2x00lib_probe_dev+0x2e0/0x4c0 [rt2x00lib]
> Feb  1 20:22:39 localhost kernel: [<ffffffffa01502ad>]
> rt2x00usb_probe+0x14d/0x310 [rt2x00usb]

Can you double check rfkill module is from compat-wireless
and not from you kernel?
Or maybe compat-wireless is currently broken, try an older tarball.
It doesn't look at first glance like a rt2x00 specific issue.

BTW, output from dmesg also contains the actual crash
reason which is not in /var/log/messages due to your syslog config.


HTH,
Johannes

^ permalink raw reply

* Re: Early crash (was: Re: module: show version information for built-in modules in sysfs)
From: Dmitry Torokhov @ 2011-02-01 21:09 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rusty Russell, linux-kernel@vger.kernel.org, Linux/m68k
In-Reply-To: <AANLkTin4gOnEMruLDM=TkNYsNf5S370WqbcDVJzT7_Z4@mail.gmail.com>

On Tue, Feb 01, 2011 at 12:33:29PM -0800, Geert Uytterhoeven wrote:
> On Mon, Jan 24, 2011 at 11:59, Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org> wrote:
> > Gitweb:     http://git.kernel.org/linus/e94965ed5beb23c6fabf7ed31f625e66d7ff28de
> 
> >    module: show version information for built-in modules in sysfs
> >
> >    Currently only drivers that are built as modules have their versions
> >    shown in /sys/module/<module_name>/version, but this information might
> >    also be useful for built-in drivers as well. This especially important
> >    for drivers that do not define any parameters - such drivers, if
> >    built-in, are completely invisible from userspace.
> >
> >    This patch changes MODULE_VERSION() macro so that in case when we are
> >    compiling built-in module, version information is stored in a separate
> >    section. Kernel then uses this data to create 'version' sysfs attribute
> >    in the same fashion it creates attributes for module parameters.
> 
> This commit causes the crash below on m68k (ARAnyM).
> Reverting this commit and its dependency
> 3b90a5b292321b2acac3921f77046ae195aef53f
> ("module: fix linker error for MODULE_VERSION when !MODULE and CONFIG_SYSFS=n")
> makes it boot again.
> 

Hi Geert,

Does the follwing help by any chance?

From d6fd4a6e0fc2d3f0a74962d4a6f663a46d230ecd Mon Sep 17 00:00:00 2001
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index ef33213..47e15eb 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -141,6 +141,12 @@ SECTIONS {
 		*(__param)
 		__stop___param = .;
 
+		/* Built-in module versions */
+		. = ALIGN(4) ;
+		__start___modver = .;
+		*(__modver)
+		__stop___modver = .;
+
 		. = ALIGN(4) ;
 		_etext = . ;
 	} > TEXT

Thanks,

Dmitry

^ permalink raw reply related

* Re: [patch 07/28] posix-timers: Convert clock_nanosleep_restart to clockid_to_kclock()
From: Thomas Gleixner @ 2011-02-01 21:08 UTC (permalink / raw)
  To: John Stultz; +Cc: LKML, Richard Cochran, Ingo Molnar, Peter Zijlstra
In-Reply-To: <alpine.LFD.2.00.1102012145500.31804@localhost6.localdomain6>

On Tue, 1 Feb 2011, Thomas Gleixner wrote:
> On Tue, 1 Feb 2011, John Stultz wrote:
> 
> > On Tue, 2011-02-01 at 13:51 +0000, Thomas Gleixner wrote:
> > > plain text document attachment
> > > (posix-timers-convert-nanosleep-restart.patch)
> > > Use the new kclock decoding function in clock_nanosleep_restart. No
> > > need to check kclock here as the restart block always contains a valid
> > > clockid. If not, we are in serious trouble anyway.
> > > 
> > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > > Cc: John Stultz <john.stultz@linaro.org>
> > > Cc: Richard Cochran <richard.cochran@omicron.at>
> > 
> > One nit.
> > 
> > > -long
> > > -clock_nanosleep_restart(struct restart_block *restart_block)
> > > +long clock_nanosleep_restart(struct restart_block *restart_block)
> > >  {
> > >  	clockid_t which_clock = restart_block->arg0;
> > > +	struct k_clock *kc = clockid_to_kclock(which_clock);
> > > 
> > > -	return CLOCK_DISPATCH(which_clock, nsleep_restart,
> > > -			      (restart_block));
> > > +	return kc->nsleep_restart(restart_block);
> > >  }
> > 
> > 
> > Should you be checking if kc is null before dereferencing? Or am I being
> > overly paranoid?
> 
> See changelog. If we get a corrupted restart_block then checking kc is
> probably the least of our worries.

Ok, I'll add the checks for nsleep_restart and timer_get/set/del, but
I make them a WARN_ON_ONCE() as this is serious data corruption in the
kernel.

Thanks,

	tglx

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.