All of lore.kernel.org
 help / color / mirror / Atom feed
From: torvalds@transmeta.com (Linus Torvalds)
To: linux-kernel@vger.kernel.org
Subject: Re: Kernel is unstable
Date: 1 Mar 2001 11:12:14 -0800	[thread overview]
Message-ID: <97m6ue$7uu$1@penguin.transmeta.com> (raw)
In-Reply-To: <20010301153935.G32484@athlon.random> <E14YXh5-0008GQ-00@the-village.bc.nu> <20010301193017.E15051@athlon.random>

In article <20010301193017.E15051@athlon.random>,
Andrea Arcangeli  <andrea@suse.de> wrote:
>On Thu, Mar 01, 2001 at 06:20:49PM +0000, Alan Cox wrote:
>> > It's not broken, it's not there any longer as somebody dropped it between test7
>> > and 2.4.2, may I ask why?
>> 
>> Linus took it out because it was breaking things.
>
>If it happened to be buggy it didn't looked unfixable from a design standpoint
>and I think it was a very worthwhile feature, not just for memory but also to
>avoid growing the size of the avl that we would have to pay later all the time
>at each page fault.

The locking order was rather nasty in it (mapping->i_shared_lock and
mm->page_table_lock), and made a lot of the code much less readable than
it should have been.  And because none of the callers could know whether
the vma existed after being merged, they ended up doing strange things
that simply aren't necessary with the much simpler version. 

This, coupled with the fact that many merges could be done trivially by
hand (much faster), made me drop it.  There were a few places where it
was used where I couldn't make myself be sure that the locking was
right: I could not prove that it was buggy, but I couldn't convince
myself that it wasn't, either. 

Note how do_brk() does the merging itself (see the comment "Can we just
expand an old anonymous mapping?"), and that it's basically free when
done that way, with no worries about locking etc. The same could be done
fairly trivially in mmap too, but I never saw any real usage patterns
that made it look all that worthwhile (*). Handling the mmap case the
same way do_brk() does it would fix the behaviour of this pathological
example too..

Also note that the merging tests were not free, so at least under my set
of normal load the non-merging code is actually _faster_ than the clever
optimized merging. That was what clinched it for me: I absolutely hate
to see complexity that doesn't really buy you anything noticeable.

			Linus

(*) The only "testing" I did was really running normal applications and
then checking how many merges could be done on /proc/*/maps. Under
normal load I did not see very many at all - I had something like six
missed merges while running my normal set of applications (X, KDE etc).
Others can obviously have very different usage patterns.

  parent reply	other threads:[~2001-03-01 19:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-01  9:16 Kernel is unstable Ivan Stepnikov
2001-03-01 10:27 ` Matti Aarnio
2001-03-01 14:35   ` Andrea Arcangeli
2001-03-01 14:39     ` Andrea Arcangeli
2001-03-01 18:20       ` Alan Cox
2001-03-01 18:30         ` Andrea Arcangeli
2001-03-01 19:04           ` David S. Miller
2001-03-01 20:45             ` Andrea Arcangeli
2001-03-01 19:12           ` Linus Torvalds [this message]
2001-03-02  8:23             ` Christoph Rohland
2001-03-02  8:40             ` David Howells
2001-03-02 14:01               ` Andrea Arcangeli
2001-03-02 17:52               ` Linus Torvalds
2001-03-05 23:06                 ` Chris Wedgwood
2001-03-01 13:39 ` Richard B. Johnson
2001-03-01 14:24 ` Andrea Arcangeli
2001-03-01 17:12   ` Ingo Oeser
  -- strict thread matches above, loose matches on Subject: below --
2001-03-01 13:55 Heusden, Folkert van

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='97m6ue$7uu$1@penguin.transmeta.com' \
    --to=torvalds@transmeta.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.