Re: [PATCH 21/36] x86/tdx: Remove TDX_HCALL_ISSUE_STI

2022-06-13 Thread Lai Jiangshan
kernel.org, VMware Inc , linux-snps-...@lists.infradead.org, mgor...@suse.de, jacob.jun@linux.intel.com, Arnd Bergmann , ulli.kr...@googlemail.com, vgu...@kernel.org, linux-...@vger.kernel.org, j...@joshtriplett.org, rost...@goodmis.org, r...@vger.kernel.org, Borislav Petkov , bc...@quicin

Re: [PATCH] kthread: kthread_bind fails to enforce CPU affinity (fixes kernel BUG at kernel/smpboot.c:134!)

2014-12-08 Thread Lai Jiangshan
On 12/08/2014 09:54 PM, Steven Rostedt wrote: > On Mon, 8 Dec 2014 14:27:01 +1100 > Anton Blanchard wrote: > >> I have a busy ppc64le KVM box where guests sometimes hit the infamous >> "kernel BUG at kernel/smpboot.c:134!" issue during boot: >> >> BUG_ON(td->cpu != smp_processor_id()); >> >> Bas

Re: [RFC 1/2] workqueue: use the nearest NUMA node, not the local one

2014-07-18 Thread Lai Jiangshan
Hi, I'm curious about what will it happen when alloc_pages_node(memoryless_node). If the memory is allocated from the most preferable node for the @memoryless_node, why we need to bother and use cpu_to_mem() in the caller site? If not, why the memory allocation subsystem refuses to find a prefe

[PATCH 1/9] powerpc,kvm: fix imbalance srcu_read_[un]lock()

2013-03-15 Thread Lai Jiangshan
At the point of up_out label in kvmppc_hv_setup_htab_rma(), srcu read lock is still held. We have to release it before return. Signed-off-by: Lai Jiangshan Cc: Marcelo Tosatti Cc: Gleb Natapov Cc: Alexander Graf Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: k...@vger.kernel.org Cc: kvm

Re: [PATCH] lglock: add read-preference local-global rwlock

2013-03-05 Thread Lai Jiangshan
On 03/03/13 01:06, Oleg Nesterov wrote: > On 03/02, Michel Lespinasse wrote: >> >> My version would be slower if it needs to take the >> slow path in a reentrant way, but I'm not sure it matters either :) > > I'd say, this doesn't matter at all, simply because this can only happen > if we race wit

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-03-05 Thread Lai Jiangshan
On 02/03/13 03:47, Srivatsa S. Bhat wrote: > On 03/01/2013 11:20 PM, Lai Jiangshan wrote: >> On 28/02/13 05:19, Srivatsa S. Bhat wrote: >>> On 02/27/2013 06:03 AM, Lai Jiangshan wrote: >>>> On Wed, Feb 27, 2013 at 3:30 AM, Srivatsa S. Bhat >>>> wrote: &

Re: [PATCH V2] lglock: add read-preference local-global rwlock

2013-03-05 Thread Lai Jiangshan
On 03/03/13 01:11, Srivatsa S. Bhat wrote: > On 03/02/2013 06:44 PM, Lai Jiangshan wrote: >> From 345a7a75c314ff567be48983e0892bc69c4452e7 Mon Sep 17 00:00:00 2001 >> From: Lai Jiangshan >> Date: Sat, 2 Mar 2013 20:33:14 +0800 >> Subject: [PATCH] lglock: add read-pre

Re: [PATCH V2] lglock: add read-preference local-global rwlock

2013-03-05 Thread Lai Jiangshan
On 03/03/13 01:20, Oleg Nesterov wrote: > On 03/02, Lai Jiangshan wrote: >> >> +void lg_rwlock_local_read_unlock(struct lgrwlock *lgrw) >> +{ >> +switch (__this_cpu_read(*lgrw->reader_refcnt)) { >> +case 1: >> +

Re: [PATCH] lglock: add read-preference local-global rwlock

2013-03-02 Thread Lai Jiangshan
On 02/03/13 02:28, Oleg Nesterov wrote: > Lai, I didn't read this discussion except the code posted by Michel. > I'll try to read this patch carefully later, but I'd like to ask > a couple of questions. > > This version looks more complex than Michel's, why? Just curious, I > am trying to understa

[PATCH V2] lglock: add read-preference local-global rwlock

2013-03-02 Thread Lai Jiangshan
>From 345a7a75c314ff567be48983e0892bc69c4452e7 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Sat, 2 Mar 2013 20:33:14 +0800 Subject: [PATCH] lglock: add read-preference local-global rwlock Current lglock is not read-preference, so it can't be used on some cases which read-preferenc

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-03-01 Thread Lai Jiangshan
On 28/02/13 05:19, Srivatsa S. Bhat wrote: > On 02/27/2013 06:03 AM, Lai Jiangshan wrote: >> On Wed, Feb 27, 2013 at 3:30 AM, Srivatsa S. Bhat >> wrote: >>> On 02/26/2013 09:55 PM, Lai Jiangshan wrote: >>>> On Tue, Feb 26, 2013 at 10:22 PM, Srivatsa S.

[PATCH] lglock: add read-preference local-global rwlock

2013-03-01 Thread Lai Jiangshan
>From c63f2be9a4cf7106a521dda169a0e14f8e4f7e3b Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Mon, 25 Feb 2013 23:14:27 +0800 Subject: [PATCH] lglock: add read-preference local-global rwlock Current lglock is not read-preference, so it can't be used on some cases which read-preferenc

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Wed, Feb 27, 2013 at 3:30 AM, Srivatsa S. Bhat wrote: > On 02/26/2013 09:55 PM, Lai Jiangshan wrote: >> On Tue, Feb 26, 2013 at 10:22 PM, Srivatsa S. Bhat >> wrote: >>> >>> Hi Lai, >>> >>> I'm really not convinced that piggy-backing on

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 10:22 PM, Srivatsa S. Bhat wrote: > > Hi Lai, > > I'm really not convinced that piggy-backing on lglocks would help > us in any way. But still, let me try to address some of the points > you raised... > > On 02/26/2013 06:29 PM, Lai Jiangshan w

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Mon, Feb 18, 2013 at 8:38 PM, Srivatsa S. Bhat wrote: > Using global rwlocks as the backend for per-CPU rwlocks helps us avoid many > lock-ordering related problems (unlike per-cpu locks). However, global > rwlocks lead to unnecessary cache-line bouncing even when there are no > writers present

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 3:26 AM, Srivatsa S. Bhat wrote: > Hi Lai, > > On 02/25/2013 09:23 PM, Lai Jiangshan wrote: >> Hi, Srivatsa, >> >> The target of the whole patchset is nice for me. > > Cool! Thanks :-) > >> A question: How did you find out the

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 5:02 PM, Srivatsa S. Bhat wrote: > On 02/26/2013 05:47 AM, Lai Jiangshan wrote: >> On Tue, Feb 26, 2013 at 3:26 AM, Srivatsa S. Bhat >> wrote: >>> Hi Lai, >>> >>> On 02/25/2013 09:23 PM, Lai Jiangshan wrote: >>>> Hi, S

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-25 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 8:17 AM, Lai Jiangshan wrote: > On Tue, Feb 26, 2013 at 3:26 AM, Srivatsa S. Bhat > wrote: >> Hi Lai, >> >> On 02/25/2013 09:23 PM, Lai Jiangshan wrote: >>> Hi, Srivatsa, >>> >>> The target of the whole patchset is ni

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-25 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 3:26 AM, Srivatsa S. Bhat wrote: > Hi Lai, > > On 02/25/2013 09:23 PM, Lai Jiangshan wrote: >> Hi, Srivatsa, >> >> The target of the whole patchset is nice for me. > > Cool! Thanks :-) > >> A question: How did you find out the

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-25 Thread Lai Jiangshan
untested draft here. Thanks, Lai PS: Some HA tools(I'm writing one) which takes checkpoints of virtual-machines frequently, I guess this patchset can speedup the tools. >From 01db542693a1b7fc6f9ece45d57cb529d9be5b66 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Mon, 25 Feb 2013