Steven,<br><br>cat /proc/meminfo<br>...<br>HugePages_Total:       0<br>HugePages_Free:        0<br>HugePages_Rsvd:        0<br>HugePages_Surp:        0<br>Hugepagesize:       4096 kB<br>...<br><br>Its 4MB..<br><br>How can i disable hugetlb ? ( passing CONFIG_HUGETLBFS=n at boot to kernel ?) <br>
<br><div class="gmail_quote">2011/6/1 Steven Dake <span dir="ltr"><<a href="mailto:sdake@redhat.com">sdake@redhat.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On 06/01/2011 01:05 AM, Steven Dake wrote:<br>
> On 05/31/2011 09:44 PM, Angus Salkeld wrote:<br>
>> On Tue, May 31, 2011 at 11:52:48PM -0300, william felipe_welter wrote:<br>
>>> Angus,<br>
>>><br>
>>> I make some test program (based on the code coreipcc.c) and i now i sure<br>
>>> that are problems with the mmap systems call on sparc..<br>
>>><br>
>>> Source code of my test program:<br>
>>><br>
>>> #include <stdlib.h><br>
>>> #include <sys/mman.h><br>
>>> #include <stdio.h><br>
>>><br>
>>> #define PATH_MAX  36<br>
>>><br>
>>> int main()<br>
>>> {<br>
>>><br>
>>> int32_t fd;<br>
>>> void *addr_orig;<br>
>>> void *addr;<br>
>>> char path[PATH_MAX];<br>
>>> const char *file = "teste123XXXXXX";<br>
>>> size_t bytes=10024;<br>
>>><br>
>>> snprintf (path, PATH_MAX, "/dev/shm/%s", file);<br>
>>> printf("PATH=%s\n",path);<br>
>>><br>
>>> fd = mkstemp (path);<br>
>>> printf("fd=%d \n",fd);<br>
>>><br>
>>><br>
>>> addr_orig = mmap (NULL, bytes, PROT_NONE,<br>
>>>               MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);<br>
>>><br>
>>><br>
>>> addr = mmap (addr_orig, bytes, PROT_READ | PROT_WRITE,<br>
>>>               MAP_FIXED | MAP_SHARED, fd, 0);<br>
>>><br>
>>> printf("ADDR_ORIG:%p  ADDR:%p\n",addr_orig,addr);<br>
>>><br>
>>><br>
>>>   if (addr != addr_orig) {<br>
>>>                printf("Erro");<br>
>>>         }<br>
>>> }<br>
>>><br>
>>> Results on x86:<br>
>>> PATH=/dev/shm/teste123XXXXXX<br>
>>> fd=3<br>
>>> ADDR_ORIG:0x7f867d8e6000  ADDR:0x7f867d8e6000<br>
>>><br>
>>> Results on sparc:<br>
>>> PATH=/dev/shm/teste123XXXXXX<br>
>>> fd=3<br>
>>> ADDR_ORIG:0xf7f72000  ADDR:0xffffffff<br>
>><br>
>> Note: 0xffffffff == MAP_FAILED<br>
>><br>
>> (from man mmap)<br>
>> RETURN VALUE<br>
>>        On success, mmap() returns a pointer to the mapped area.  On<br>
>>        error, the value MAP_FAILED (that is, (void *) -1) is returned,<br>
>>        and errno is  set appropriately.<br>
>><br>
>>><br>
>>><br>
>>> But im wondering if is really needed to call mmap 2 times ?  What are the<br>
>>> reason to call the mmap 2 times, on the second time using the address of the<br>
>>> first?<br>
>>><br>
>>><br>
>> Well there are 3 calls to mmap()<br>
>> 1) one to allocate 2 * what you need (in pages)<br>
>> 2) maps the first half of the mem to a real file<br>
>> 3) maps the second half of the mem to the same file<br>
>><br>
>> The point is when you write to an address over the end of the<br>
>> first half of memory it is taken care of the the third mmap which maps<br>
>> the address back to the top of the file for you. This means you<br>
>> don't have to worry about ringbuffer wrapping which can be a headache.<br>
>><br>
>> -Angus<br>
>><br>
><br>
> interesting this mmap operation doesn't work on sparc linux.<br>
><br>
> Not sure how I can help here - Next step would be a follow up with the<br>
> sparc linux mailing list.  I'll do that and cc you on the message - see<br>
> if we get any response.<br>
><br>
> <a href="http://vger.kernel.org/vger-lists.html" target="_blank">http://vger.kernel.org/vger-lists.html</a><br>
><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> 2011/5/31 Angus Salkeld <<a href="mailto:asalkeld@redhat.com">asalkeld@redhat.com</a>><br>
>>><br>
>>>> On Tue, May 31, 2011 at 06:25:56PM -0300, william felipe_welter wrote:<br>
>>>>> Thanks Steven,<br>
>>>>><br>
>>>>> Now im try to run on the MCP:<br>
>>>>> - Uninstall the pacemaker 1.0<br>
>>>>> - Compile and install 1.1<br>
>>>>><br>
>>>>> But now i have problems to initialize the pacemakerd: Could not<br>
>>>> initialize<br>
>>>>> Cluster Configuration Database API instance error 2<br>
>>>>> Debbuging with gdb i see that the error are on the confdb.. most<br>
>>>> specificaly<br>
>>>>> the errors start on coreipcc.c  at line:<br>
>>>>><br>
>>>>><br>
>>>>> 448        if (addr != addr_orig) {<br>
>>>>> 449                goto error_close_unlink;  <- enter here<br>
>>>>> 450       }<br>
>>>>><br>
>>>>> Some ideia about  what can cause this  ?<br>
>>>>><br>
>>>><br>
>>>> I tried porting a ringbuffer (<a href="http://www.libqb.org" target="_blank">www.libqb.org</a>) to sparc and had the same<br>
>>>> failure.<br>
>>>> There are 3 mmap() calls and on sparc the third one keeps failing.<br>
>>>><br>
>>>> This is a common way of creating a ring buffer, see:<br>
>>>> <a href="http://en.wikipedia.org/wiki/Circular_buffer#Exemplary_POSIX_Implementation" target="_blank">http://en.wikipedia.org/wiki/Circular_buffer#Exemplary_POSIX_Implementation</a><br>
>>>><br>
>>>> I couldn't get it working in the short time I tried. It's probably<br>
>>>> worth looking at the clib implementation to see why it's failing<br>
>>>> (I didn't get to that).<br>
>>>><br>
>>>> -Angus<br>
>>>><br>
<br>
</div></div>Note, we sorted this out we believe.  Your kernel has hugetlb enabled,<br>
probably with 4MB pages.  This requires corosync to allocate 4MB pages.<br>
<br>
Can you verify your hugetlb settings?<br>
<br>
If you can turn this option off, you should have atleast a working corosync.<br>
<br>
Regards<br>
-steve<br>
<div><div></div><div class="h5">>>>><br>
>>>> _______________________________________________<br>
>>>> Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
>>>> <a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
>>>><br>
>>>> Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
>>>> Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
>>>> Bugs:<br>
>>>> <a href="http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> William Felipe Welter<br>
>>> ------------------------------<br>
>>> Consultor em Tecnologias Livres<br>
>>> <a href="mailto:william.welter@4linux.com.br">william.welter@4linux.com.br</a><br>
>>> <a href="http://www.4linux.com.br" target="_blank">www.4linux.com.br</a><br>
>><br>
>>> _______________________________________________<br>
>>> Openais mailing list<br>
>>> <a href="mailto:Openais@lists.linux-foundation.org">Openais@lists.linux-foundation.org</a><br>
>>> <a href="https://lists.linux-foundation.org/mailman/listinfo/openais" target="_blank">https://lists.linux-foundation.org/mailman/listinfo/openais</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
>> <a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
>><br>
>> Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
>> Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
>> Bugs: <a href="http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
><br>
> _______________________________________________<br>
> Openais mailing list<br>
> <a href="mailto:Openais@lists.linux-foundation.org">Openais@lists.linux-foundation.org</a><br>
> <a href="https://lists.linux-foundation.org/mailman/listinfo/openais" target="_blank">https://lists.linux-foundation.org/mailman/listinfo/openais</a><br>
<br>
<br>
_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>William Felipe Welter<br>------------------------------<br>Consultor em Tecnologias Livres<br><a href="mailto:william.welter@4linux.com.br" target="_blank">william.welter@4linux.com.br</a><br>
<a href="http://www.4linux.com.br" target="_blank">www.4linux.com.br</a><br><br>