public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: hugh@veritas.com (Hugh Dickins)
Cc: alan@lxorguk.ukuu.org.uk (Alan Cox),
	tytso@mit.edu (Theodore Ts'o),
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] alloc_tty_struct() wastage?
Date: Fri, 2 Mar 2001 23:37:26 +0000 (GMT)	[thread overview]
Message-ID: <200103022337.XAA01526@raistlin.arm.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.21.0103022326070.1719-100000@localhost.localdomain> from "Hugh Dickins" at Mar 02, 2001 11:29:02 PM

Hugh Dickins writes:
> I've been puzzling over alloc_tty_struct(), which seems determined
> to waste memory on a machine of page size 8KB.

Maybe you could change the ">" to ">="?

> I've come to the conclusion that it represents great caution on
> Russell's part when introducing ARM, not to interfere with
> existing code of other architectures - is that so, Russell?

My understanding of the usage of get_free_page there is as follows:
The problem was that sizeof(struct tty_struct) was very close to
the page size of x86 machines (4K), and kmalloc wasted space
unnecessarily.  Therefore get_free_page was used by x86 to allocate
this structure.  I think I'm right in saying that allocating
anything larger than half your page size is best done with
get_free_page.

Someone will probably correct me on that comment above though.
Can someone confirm please: is it safe and reasonable to use
kmalloc on allocating tty_struct on all architectures now?

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


      reply	other threads:[~2001-03-02 23:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-02 17:47 Linux 2.4.2ac9 Alan Cox
2001-03-02 21:37 ` [PATCH] QIC-02 tape broken buffaddr Hugh Dickins
2001-03-05 15:52   ` lvm_snap calc_max_buckets num_physpages Hugh Dickins
2001-03-05 15:55   ` netfilter ip_conntrack num_physpages Hugh Dickins
2001-03-29 14:20   ` [PATCH] sparc64 module_map dont vfree Hugh Dickins
2001-04-17 14:00     ` [PATCH] emu10k1/audio un reserve Hugh Dickins
2001-03-02 21:39 ` [PATCH] CS89x0 demands too many pages Hugh Dickins
2001-03-03 12:39   ` [PATCH] cs89x0.c Andrew Morton
2001-03-02 21:41 ` [PATCH] getname() buffer overflow Hugh Dickins
2001-03-02 23:29 ` [PATCH] alloc_tty_struct() wastage? Hugh Dickins
2001-03-02 23:37   ` Russell King [this message]

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=200103022337.XAA01526@raistlin.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox