This is the mail archive of the
mailing list for the GCC project.
Re: [rfc] a different pch/exec-shield cleanup
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Richard Henderson <rth at twiddle dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 06 Mar 2004 15:48:31 -0500
- Subject: Re: [rfc] a different pch/exec-shield cleanup
- References: <20040306202333.GA4212@twiddle.net>
Richard Henderson <email@example.com> writes:
> This seems to work ok. I'm somewhat partial to breaking out all the
> logic for mapping and whatnot into the hook routines, as it seems to
> be easier to follow that way.
> The suggestion to allocate a ~32M vm hole comes from Ingo Molnar.
> The hint that 1.5G to 2.5G tends to be free on x86 no matter what
> the kernel memory model is comes from Arjan van de Ven.
> I suppose that leaves the question of what to do with mincore.
> Should it get shoved into a Solaris-specific host hook like this,
> or should it stay in ggc-common.c as mmap_mincore_gt_pch_use_address?
Looks good to me. The x86 memory space hints are helpful. Definitely
easier to understand what is going on.
You didn't update doc/hostconfig.texi. Note that I sent a rewrite
this morning, although that rewrite is now partly out of date.
I suspect I managed to put ggc-common.c into a state which is
inappropriate for Solaris. Mea culpa. I think your Solaris routine
should look like this--munmap addr before calling mincore. I moved it
to fix a different problem, and probably introduced a new one.
if (addr != base)
size_t page_size = getpagesize ();
if (addr != (void *) MAP_FAILED)
munmap (addr, size);
errno = 0;
for (i = 0; i < size; i += page_size)
if (mincore ((char *)base + i, page_size, (void *)&one_byte) == -1
&& errno == ENOMEM)
continue; /* The page is not mapped. */
if (i >= size)
addr = mmap (base, size,
PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,