From: Andrew Morton <akpm@osdl.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.6-mm2
Date: Thu, 13 May 2004 04:25:40 -0700 [thread overview]
Message-ID: <20040513042540.073478ea.akpm@osdl.org> (raw)
In-Reply-To: <20040513121206.A8620@infradead.org>
Christoph Hellwig <hch@infradead.org> wrote:
>
> On Thu, May 13, 2004 at 03:51:34AM -0700, Andrew Morton wrote:
> > Once I'm convinced that kernel.org kernels will be able to run applications
> > which vendor kernels will run, sure.
> >
> > We're nowhere near that, and your continual whining gets us no closer.
>
> Sorry, but this argumentation is utter bullshit.
Wim explained that any application changes now won't be widely deployed for
another year. During that period the ability to run existing Oracle setups
requires that hugepage allocation be available to unprivileged
applications.
> If $VENDORKERNEL/freebsd/sco/windows2000 runs $APP and we don't, what
> does this mean? Right, exactly nothing.
It means that if people install a kernel.org machine on their database
server, the database *just won't work*. This is not good for those users,
for the kernel developers or for Linux's reputation in general.
It's worth a very small, extremely easily maintainable patch to fix all
this up.
And this is not just any old application.
> I've talked to three persons at Oracle and neither likes it at all, in
> fact en Oracle employee is working on doing quota for hugetlbfs which
> fixes this properly.
One year.
> Merging some horrible hacks that completly change
> the authorization model (for a special case, that is)
If you need to exaggerate this much to make your point, it isn't a very
good point.
> in the middle of
> stable series doesn't get us anywhere, except into a horrible unmaintable
> mess.
Here's your "horrible unmaintainable mess":
diff -puN fs/hugetlbfs/inode.c~hugetlb_shm_group-sysctl-patch fs/hugetlbfs/inode.c
--- 25/fs/hugetlbfs/inode.c~hugetlb_shm_group-sysctl-patch 2004-05-10 04:48:58.627456560 -0700
+++ 25-akpm/fs/hugetlbfs/inode.c 2004-05-10 04:48:58.640454584 -0700
@@ -43,6 +43,8 @@ static struct backing_dev_info hugetlbfs
.memory_backed = 1, /* Does not contribute to dirty memory */
};
+int sysctl_hugetlb_shm_group;
+
static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
{
struct inode *inode = file->f_dentry->d_inode;
@@ -718,6 +720,12 @@ static unsigned long hugetlbfs_counter(v
return ret;
}
+static int can_do_hugetlb_shm(void)
+{
+ return likely(capable(CAP_IPC_LOCK) ||
+ in_group_p(sysctl_hugetlb_shm_group));
+}
+
struct file *hugetlb_zero_setup(size_t size)
{
int error;
@@ -727,7 +735,7 @@ struct file *hugetlb_zero_setup(size_t s
struct qstr quick_string;
char buf[16];
- if (!capable(CAP_IPC_LOCK))
+ if (!can_do_hugetlb_shm())
return ERR_PTR(-EPERM);
if (!is_hugepage_mem_enough(size))
diff -puN include/linux/hugetlb.h~hugetlb_shm_group-sysctl-patch include/linux/hugetlb.h
--- 25/include/linux/hugetlb.h~hugetlb_shm_group-sysctl-patch 2004-05-10 04:48:58.628456408 -0700
+++ 25-akpm/include/linux/hugetlb.h 2004-05-10 04:48:58.641454432 -0700
@@ -32,6 +32,7 @@ void free_huge_page(struct page *);
extern unsigned long max_huge_pages;
extern const unsigned long hugetlb_zero, hugetlb_infinity;
+extern int sysctl_hugetlb_shm_group;
static inline void
mark_mm_hugetlb(struct mm_struct *mm, struct vm_area_struct *vma)
diff -puN include/linux/sysctl.h~hugetlb_shm_group-sysctl-patch include/linux/sysctl.h
--- 25/include/linux/sysctl.h~hugetlb_shm_group-sysctl-patch 2004-05-10 04:48:58.630456104 -0700
+++ 25-akpm/include/linux/sysctl.h 2004-05-10 04:48:58.643454128 -0700
@@ -163,6 +163,7 @@ enum
VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */
VM_LAPTOP_MODE=23, /* vm laptop mode */
VM_BLOCK_DUMP=24, /* block dump mode */
+ VM_HUGETLB_GROUP=25, /* permitted hugetlb group */
};
diff -puN kernel/sysctl.c~hugetlb_shm_group-sysctl-patch kernel/sysctl.c
--- 25/kernel/sysctl.c~hugetlb_shm_group-sysctl-patch 2004-05-10 04:48:58.632455800 -0700
+++ 25-akpm/kernel/sysctl.c 2004-05-10 04:48:58.645453824 -0700
@@ -738,6 +738,14 @@ static ctl_table vm_table[] = {
.extra1 = (void *)&hugetlb_zero,
.extra2 = (void *)&hugetlb_infinity,
},
+ {
+ .ctl_name = VM_HUGETLB_GROUP,
+ .procname = "hugetlb_shm_group",
+ .data = &sysctl_hugetlb_shm_group,
+ .maxlen = sizeof(gid_t),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
#endif
{
.ctl_name = VM_LOWER_ZONE_PROTECTION,
_
Please, spare me the hyperbole.
next prev parent reply other threads:[~2004-05-13 11:26 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-13 10:27 2.6.6-mm2 Andrew Morton
2004-05-13 10:45 ` 2.6.6-mm2 Christoph Hellwig
2004-05-13 10:51 ` 2.6.6-mm2 Andrew Morton
2004-05-13 11:12 ` 2.6.6-mm2 Christoph Hellwig
2004-05-13 11:25 ` Andrew Morton [this message]
2004-05-13 13:18 ` 2.6.6-mm2 Adrian Bunk
2004-05-13 13:39 ` 2.6.6-mm2 Chris Mason
2004-05-13 14:09 ` 2.6.6-mm2 Adrian Bunk
2004-05-17 20:52 ` 2.6.6-mm2 Bill Davidsen
2004-05-14 7:30 ` 2.6.6-mm2 Ian Kent
2004-05-13 14:15 ` 2.6.6-mm2 Adrian Bunk
2004-05-13 19:18 ` 2.6.6-mm2 Chris Wright
2004-05-13 19:29 ` 2.6.6-mm2 Andrew Morton
2004-05-13 19:35 ` 2.6.6-mm2 Chris Wright
2004-05-13 19:38 ` 2.6.6-mm2 Andrew Morton
2004-05-13 19:42 ` 2.6.6-mm2 Chris Wright
2004-05-14 19:14 ` 2.6.6-mm2 Andrea Arcangeli
2004-05-14 20:58 ` 2.6.6-mm2 Chris Wright
2004-05-15 2:43 ` 2.6.6-mm2 Andrea Arcangeli
2004-05-15 7:43 ` 2.6.6-mm2 Hugh Dickins
2004-05-14 19:06 ` 2.6.6-mm2 Kevin O'Connor
2004-05-14 19:36 ` 2.6.6-mm2 Chris Wright
2004-05-14 19:42 ` 2.6.6-mm2 Kevin O'Connor
2004-05-13 10:53 ` 2.6.6-mm2, usb ehci warnings/error? Prakash K. Cheemplavam
2004-05-13 12:11 ` 2.6.6-mm-rc3-mm2 USB 2.0 after suspend issue Ari Pollak
2004-05-13 12:14 ` 2.6.6-mm2 Matt H.
2004-05-13 18:24 ` 2.6.6-mm2 Andrew Morton
2004-05-13 22:40 ` 2.6.6-mm2 Greg KH
2004-05-13 12:54 ` i810 AGP fails to initialise (was Re: 2.6.6-mm2) Sean Neakums
2004-05-13 13:53 ` Dave Jones
2004-05-13 13:58 ` Andi Kleen
2004-05-13 14:02 ` Sean Neakums
2004-05-13 15:41 ` Andi Kleen
2004-05-14 3:47 ` Clemens Schwaighofer
2004-05-14 7:42 ` Sean Neakums
2004-05-15 9:52 ` Sean Neakums
2004-05-17 8:49 ` Sean Neakums
2004-05-17 10:01 ` Andi Kleen
2004-05-17 11:04 ` Sean Neakums
2004-05-17 11:46 ` Andi Kleen
2004-05-17 12:37 ` Sean Neakums
2004-05-13 13:38 ` 2.6.6-mm2: EFI_VARS=m is broken Adrian Bunk
2004-05-13 15:03 ` Matt Domsch
2004-05-13 13:42 ` 2.6.6-mm2 Paolo Ornati
2004-05-13 14:01 ` 2.6.6-mm2: bk-driver-core-module-fix.patch no longer required Adrian Bunk
2004-05-13 14:36 ` Paolo Ornati
2004-05-13 15:07 ` 2.6.6-mm2 Lorenzo Allegrucci
2004-05-13 18:55 ` 2.6.6-mm2 Andrew Morton
2004-05-13 19:41 ` 2.6.6-mm2 Lorenzo Allegrucci
2004-05-14 17:48 ` 2.6.6-mm2 R. J. Wysocki
2004-05-14 17:47 ` 2.6.6-mm2 Christoph Hellwig
2004-05-14 21:20 ` 2.6.6-mm2 R. J. Wysocki
2004-05-14 23:56 ` 2.6.6-mm2 Joseph Fannin
2004-05-14 23:58 ` 2.6.6-mm2 Chris Wright
2004-05-13 12:39 2.6.6-mm2 Oleg Nesterov
2004-05-13 18:28 ` 2.6.6-mm2 Andrew Morton
2004-05-13 23:51 ` 2.6.6-mm2 Nick Piggin
2004-05-13 15:44 2.6.6-mm2 David Brownell
2004-05-13 19:14 2.6.6-mm2 Martin J. Bligh
2004-05-13 19:21 ` 2.6.6-mm2 Andrew Morton
2004-05-13 20:47 ` 2.6.6-mm2 Adrian Bunk
[not found] <fa.h4eq5gb.nj6q31@ifi.uio.no>
[not found] ` <fa.gi5j8pu.92umbq@ifi.uio.no>
2004-05-14 0:50 ` 2.6.6-mm2 Andy Lutomirski
2004-05-14 1:01 ` 2.6.6-mm2 Chris Wright
2004-05-14 18:51 2.6.6-mm2 Jan Killius
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=20040513042540.073478ea.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=hch@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®