From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>, Andi Kleen <ak@suse.de>,
"H. Peter Anvin" <hpa@zytor.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: cleanup - eliminate numbers in LDT allocation code
Date: Fri, 1 Feb 2008 20:14:22 +0300 [thread overview]
Message-ID: <20080201171422.GA6730@cvg> (raw)
This patch eliminates numbers in LDT allocation code
trying to make it clear to understand from where
these numbers are go
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
I hope nobody shoot me ;)
Index: linux-2.6.git/arch/x86/kernel/ldt.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/ldt.c 2008-02-01 19:30:01.000000000 +0300
+++ linux-2.6.git/arch/x86/kernel/ldt.c 2008-02-01 19:38:32.000000000 +0300
@@ -35,7 +35,8 @@ static int alloc_ldt(mm_context_t *pc, i
if (mincount <= pc->size)
return 0;
oldsize = pc->size;
- mincount = (mincount + 511) & (~511);
+ mincount = (mincount + (PAGE_SIZE / LDT_ENTRY_SIZE - 1)) &
+ (~(PAGE_SIZE / LDT_ENTRY_SIZE - 1));
if (mincount * LDT_ENTRY_SIZE > PAGE_SIZE)
newldt = vmalloc(mincount * LDT_ENTRY_SIZE);
else
next reply other threads:[~2008-02-01 17:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-01 17:14 Cyrill Gorcunov [this message]
2008-02-01 17:18 ` [PATCH] x86: cleanup - eliminate numbers in LDT allocation code Ingo Molnar
2008-02-01 17:27 ` Cyrill Gorcunov
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=20080201171422.GA6730@cvg \
--to=gorcunov@gmail.com \
--cc=ak@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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.