From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: 'Andy Whitcroft' <apw@shadowen.org>, 'Ray Bryant' <raybry@sgi.com>
Cc: "Martin J. Bligh" <mbligh@aracnet.com>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, anton@samba.org,
sds@epoch.ncsc.mil, ak@suse.de, lse-tech@lists.sourceforge.net,
linux-ia64@vger.kernel.org
Subject: RE: [Lse-tech] RE: [PATCH] HUGETLB memory commitment
Date: Tue, 06 Apr 2004 17:40:22 +0000 [thread overview]
Message-ID: <200404061740.i36HeLF05474@unix-os.sc.intel.com> (raw)
In-Reply-To: <25241785.1081271641@42.150.104.212.access.eclipse.net.uk>
In-Reply-To: <40717AA8.9050900@sgi.com>
>>>> Andy Whitcroft wrote on Tue, April 06, 2004 9:14 AM
> >>>>> Ray Bryant wrote on Monday, April 05, 2004 11:22 AM
> >> > Chen, Kenneth W wrote:
> >> > I actually started coding yesterday. It doesn't look too bad (I think).
> >> > I will post it once I finished it up later today or tomorrow.
> >>
> >> Hmmm...so did I. Oh well. We can pull the good ideas from both. :-)
>
> Bugger, so am I. Someone will have to merge :)
>
> > + /* we have enough hugetlb page, go ahead reserve them */
> > + switch(action) {
> > + case BACK_MERGE:
> > + curr->end = block_end;
> > + break;
> > + case FRONT_MERGE:
> > + curr->start = block_start;
> > + break;
> > + case THREE_WAY_MERGE:
> > + curr->end = next->end;
> > + list_del(p->next);
> > + kfree(next);
> > + break;
>
> I don't know if I have read this right, but if I have then you only support
> overlapping with two existing extents? What if there are extents from 0-4,
> 6-8 and 10-12 when you map 0-16? Will that not corrupt the list?
Doh, you are absolutely right that this code is broken in that scenario.
> Anyhow, below is a work in progress, ie it compiles and boots and passes
> the tests I've applied (not tested error handling well yet). The regions
> accumulation code has been extensively tested in a user level test harness,
> so I am fairly sure it works. I have split the request and commit phases
> for the region handling to allow simpler backout on other failure such as
> quota (which remains to be fixed).
>
>
> @@ -736,11 +996,18 @@ struct file *hugetlb_zero_setup(size_t s
> d_instantiate(dentry, inode);
> inode->i_size = size;
> inode->i_nlink = 0;
> + inode->i_blocks = HUGETLBFS_NOACCT;
> file->f_vfsmnt = mntget(hugetlbfs_vfsmount);
> file->f_dentry = dentry;
> file->f_mapping = inode->i_mapping;
> file->f_op = &hugetlbfs_file_operations;
> file->f_mode = FMODE_WRITE | FMODE_READ;
> +
> + error = hugetlb_acct_prepare(inode, 0, size / PAGE_SIZE);
> + if (error < 0)
> + goto out_file;
> + hugetlb_acct_commit(inode, 0, size / PAGE_SIZE);
> +
> return file;
Is this absolutely necessary? There is no vma associated at shmget().
shmat() eventually calls mmap, and that is already covered.
- Ken
prev parent reply other threads:[~2004-04-06 17:40 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-25 16:54 [PATCH] [0/6] HUGETLB memory commitment Andy Whitcroft
2004-03-25 16:58 ` [PATCH] [1/6] " Andy Whitcroft
2004-03-25 16:59 ` [PATCH] [2/6] " Andy Whitcroft
2004-03-25 17:00 ` [PATCH] [3/6] " Andy Whitcroft
2004-03-25 17:01 ` [PATCH] [4/6] " Andy Whitcroft
2004-03-25 17:02 ` [PATCH] [5/6] " Andy Whitcroft
2004-03-25 17:03 ` [PATCH] [6/6] " Andy Whitcroft
2004-03-25 21:04 ` [PATCH] [0/6] " Andrew Morton
2004-03-25 23:27 ` Andy Whitcroft
2004-03-25 23:51 ` Andrew Morton
2004-03-25 23:59 ` Andy Whitcroft
2004-03-26 2:01 ` Andy Whitcroft
2004-03-26 0:18 ` Martin J. Bligh
2004-03-28 18:02 ` Ray Bryant
2004-03-28 19:10 ` Martin J. Bligh
2004-03-28 21:32 ` [Lse-tech] " Ray Bryant
2004-03-29 16:50 ` Martin J. Bligh
2004-03-29 12:30 ` Andy Whitcroft
2004-03-26 0:10 ` Keith Owens
2004-03-26 0:22 ` Andrew Morton
2004-03-26 3:41 ` [Lse-tech] " Suparna Bhattacharya
2004-03-26 3:39 ` Keith Owens
2004-03-26 11:45 ` Suparna Bhattacharya
2004-03-29 20:45 ` Chen, Kenneth W
2004-03-29 20:49 ` Chen, Kenneth W
2004-03-30 12:57 ` Andy Whitcroft
2004-03-30 20:04 ` Chen, Kenneth W
2004-03-30 21:48 ` Andy Whitcroft
2004-03-31 1:48 ` Andy Whitcroft
2004-03-31 8:51 ` Chen, Kenneth W
2004-03-31 16:20 ` Andy Whitcroft
2004-04-01 21:15 ` Andy Whitcroft
2004-04-01 22:50 ` Andy Whitcroft
2004-04-01 23:09 ` Chen, Kenneth W
2004-04-03 3:57 ` [PATCH] " Ray Bryant
2004-04-04 3:31 ` Chen, Kenneth W
2004-04-04 22:15 ` Ray Bryant
2004-04-05 15:26 ` [Lse-tech] " Ray Bryant
2004-04-05 17:01 ` Chen, Kenneth W
2004-04-05 18:22 ` Ray Bryant
2004-04-05 23:18 ` Chen, Kenneth W
2004-04-06 1:05 ` Ray Bryant
2004-04-06 16:14 ` Andy Whitcroft
2004-04-06 17:40 ` Chen, Kenneth W [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=200404061740.i36HeLF05474@unix-os.sc.intel.com \
--to=kenneth.w.chen@intel.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=anton@samba.org \
--cc=apw@shadowen.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=mbligh@aracnet.com \
--cc=raybry@sgi.com \
--cc=sds@epoch.ncsc.mil \
/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