All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Dipankar Sarma <dipankar@in.ibm.com>
Cc: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org,
	Paul Mckenney <paul.mckenney@us.ibm.com>
Subject: Re: 2.4.10pre7aa1
Date: Wed, 12 Sep 2001 16:03:13 +0200	[thread overview]
Message-ID: <20010912160313.A695@athlon.random> (raw)
In-Reply-To: <20010912163426.A5979@in.ibm.com>
In-Reply-To: <20010912163426.A5979@in.ibm.com>; from dipankar@in.ibm.com on Wed, Sep 12, 2001 at 04:34:26PM +0530

On Wed, Sep 12, 2001 at 04:34:26PM +0530, Dipankar Sarma wrote:
> In article <20010912182440.3975719b.rusty@rustcorp.com.au> you wrote:
> > On Mon, 10 Sep 2001 17:54:17 +0200
> > Andrea Arcangeli <andrea@suse.de> wrote:
> >> Only in 2.4.10pre7aa1: 00_rcu-1
> >> 
> >> 	wait_for_rcu and call_rcu implementation (from IBM). I did some
> >> 	modifications with respect to the original version from IBM.
> >> 	In particular I dropped the vmalloc_rcu/kmalloc_rcu, the
> >> 	rcu_head must always be allocated in the data structures, it has
> >> 	to be a field of a class, rather than hiding it in the allocation
> >> 	and playing dirty and risky with casts on a bigger allocation.
> 
> > Hi Andrea, 
> 
> > 	Like the kernel threads approach, but AFAICT it won't work for the case of two CPUs running wait_for_rcu at the same time (on a 4-way or above).

Good catch!

As for your alternate approch patch I've a few comments:

1) there maybe an RT tasks running, shrinking ram without reschedules in
between (ignore the current page_alloc that does a bogus schedule before
starting memory balancing), so schedule may never run and the RT task
can run oom, so you should at least set need_resched of the interesting
cpus + send the IPI reschedule before returning from call_rcu to avoid
to be starved

2) the real design issue here if we should pay 8k per-cpu and zero cpu
cost for the fast paths, or if we want to pay with a new branch in
schedule() fast path, I preferred the krcud approch for that reason:

+       if (atomic_read(&rcu_pending))
+               goto rcu_process;
+rcu_process_back:

> The patch I submitted to Andrea had logic to make sure that
> two CPUs don't execute wait_for_rcu() at the same time.
> Somehow it seems to have got lost in Andrea's modifications.

I think the bug was in your original patch too, I'm pretty sure I didn't
broke anything while changing the API a little.

> I will look at that and submit a new patch to Andrea, if necessary.

I prefer to allow all cpus to enter wait_for_rcu at the same time rather
than putting a serializing semaphore around wait_for_rcu (it should
scale pretty well if we don't serialize around wait_for_rcu).

The way I prefer to fix it is just to replace the rcu_sema with a per-cpu
semaphore and have wait_for_rcu running down on such per-cpu semaphore
of the interesting cpu, should be a few liner patch (we have space
free for it in the per-cpu rcu_data cacheline).

> As for wrappers, I am agnostic. However, I think sooner or later
> people will start asking for them, if we go by our past experience.

Maybe I'm missing something but what's the problem in allocating the
struct rcu_head in the data structure? I don't think it's not much more
complicated than the cast magics, and in general I prefer to avoid casts
on larger buffers to get advantage of the C compile time sanity checking ;).

Andrea

  reply	other threads:[~2001-09-12 14:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-12 11:04 2.4.10pre7aa1 Dipankar Sarma
2001-09-12 14:03 ` Andrea Arcangeli [this message]
2001-09-12 14:42   ` 2.4.10pre7aa1 Dipankar Sarma
2001-09-12 14:53     ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-16 12:23       ` 2.4.10pre7aa1 Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2001-09-17  9:13 2.4.10pre7aa1 Dipankar Sarma
     [not found] <20010910175416.A714@athlon.random>
2001-09-10 17:41 ` 2.4.10pre7aa1 Christoph Hellwig
2001-09-10 18:03   ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-10 18:49     ` 2.4.10pre7aa1 Christoph Hellwig
2001-09-10 19:01       ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-10 19:03         ` 2.4.10pre7aa1 Christoph Hellwig
2001-09-10 19:08           ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-10 18:52     ` 2.4.10pre7aa1 Christoph Hellwig
2001-09-10 19:06       ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-16 17:00         ` 2.4.10pre7aa1 Rik van Riel
2001-09-16 17:23           ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-16 17:34             ` 2.4.10pre7aa1 Rik van Riel
2001-09-16 18:16               ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-16 19:04             ` 2.4.10pre7aa1 Christoph Hellwig
2001-09-12  8:24 ` 2.4.10pre7aa1 Rusty Russell
2001-09-11 13:05 2.4.10pre7aa1 Dipankar Sarma
2001-09-11 13:56 ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-11 14:27   ` 2.4.10pre7aa1 Dipankar Sarma
2001-09-11 12:22 2.4.10pre7aa1 Dipankar Sarma
2001-09-11 11:53 2.4.10pre7aa1 Dipankar Sarma
2001-09-11 11:57 ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-11  9:39 2.4.10pre7aa1 Maneesh Soni
2001-09-11 11:12 ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-11  8:51 2.4.10pre7aa1 Dipankar Sarma
2001-09-11 11:04 ` 2.4.10pre7aa1 Andrea Arcangeli
2001-09-11 12:40   ` 2.4.10pre7aa1 Alan Cox
2001-09-11 13:49     ` 2.4.10pre7aa1 Andrea Arcangeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010912160313.A695@athlon.random \
    --to=andrea@suse.de \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.mckenney@us.ibm.com \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.