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">&lt;<a href="mailto:sdake@redhat.com">sdake@redhat.com</a>&gt;</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>
&gt; On 05/31/2011 09:44 PM, Angus Salkeld wrote:<br>
&gt;&gt; On Tue, May 31, 2011 at 11:52:48PM -0300, william felipe_welter wrote:<br>
&gt;&gt;&gt; Angus,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I make some test program (based on the code coreipcc.c) and i now i sure<br>
&gt;&gt;&gt; that are problems with the mmap systems call on sparc..<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Source code of my test program:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; #include &lt;stdlib.h&gt;<br>
&gt;&gt;&gt; #include &lt;sys/mman.h&gt;<br>
&gt;&gt;&gt; #include &lt;stdio.h&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; #define PATH_MAX  36<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; int main()<br>
&gt;&gt;&gt; {<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; int32_t fd;<br>
&gt;&gt;&gt; void *addr_orig;<br>
&gt;&gt;&gt; void *addr;<br>
&gt;&gt;&gt; char path[PATH_MAX];<br>
&gt;&gt;&gt; const char *file = &quot;teste123XXXXXX&quot;;<br>
&gt;&gt;&gt; size_t bytes=10024;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; snprintf (path, PATH_MAX, &quot;/dev/shm/%s&quot;, file);<br>
&gt;&gt;&gt; printf(&quot;PATH=%s\n&quot;,path);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; fd = mkstemp (path);<br>
&gt;&gt;&gt; printf(&quot;fd=%d \n&quot;,fd);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; addr_orig = mmap (NULL, bytes, PROT_NONE,<br>
&gt;&gt;&gt;               MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; addr = mmap (addr_orig, bytes, PROT_READ | PROT_WRITE,<br>
&gt;&gt;&gt;               MAP_FIXED | MAP_SHARED, fd, 0);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; printf(&quot;ADDR_ORIG:%p  ADDR:%p\n&quot;,addr_orig,addr);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;   if (addr != addr_orig) {<br>
&gt;&gt;&gt;                printf(&quot;Erro&quot;);<br>
&gt;&gt;&gt;         }<br>
&gt;&gt;&gt; }<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Results on x86:<br>
&gt;&gt;&gt; PATH=/dev/shm/teste123XXXXXX<br>
&gt;&gt;&gt; fd=3<br>
&gt;&gt;&gt; ADDR_ORIG:0x7f867d8e6000  ADDR:0x7f867d8e6000<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Results on sparc:<br>
&gt;&gt;&gt; PATH=/dev/shm/teste123XXXXXX<br>
&gt;&gt;&gt; fd=3<br>
&gt;&gt;&gt; ADDR_ORIG:0xf7f72000  ADDR:0xffffffff<br>
&gt;&gt;<br>
&gt;&gt; Note: 0xffffffff == MAP_FAILED<br>
&gt;&gt;<br>
&gt;&gt; (from man mmap)<br>
&gt;&gt; RETURN VALUE<br>
&gt;&gt;        On success, mmap() returns a pointer to the mapped area.  On<br>
&gt;&gt;        error, the value MAP_FAILED (that is, (void *) -1) is returned,<br>
&gt;&gt;        and errno is  set appropriately.<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; But im wondering if is really needed to call mmap 2 times ?  What are the<br>
&gt;&gt;&gt; reason to call the mmap 2 times, on the second time using the address of the<br>
&gt;&gt;&gt; first?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt; Well there are 3 calls to mmap()<br>
&gt;&gt; 1) one to allocate 2 * what you need (in pages)<br>
&gt;&gt; 2) maps the first half of the mem to a real file<br>
&gt;&gt; 3) maps the second half of the mem to the same file<br>
&gt;&gt;<br>
&gt;&gt; The point is when you write to an address over the end of the<br>
&gt;&gt; first half of memory it is taken care of the the third mmap which maps<br>
&gt;&gt; the address back to the top of the file for you. This means you<br>
&gt;&gt; don&#39;t have to worry about ringbuffer wrapping which can be a headache.<br>
&gt;&gt;<br>
&gt;&gt; -Angus<br>
&gt;&gt;<br>
&gt;<br>
&gt; interesting this mmap operation doesn&#39;t work on sparc linux.<br>
&gt;<br>
&gt; Not sure how I can help here - Next step would be a follow up with the<br>
&gt; sparc linux mailing list.  I&#39;ll do that and cc you on the message - see<br>
&gt; if we get any response.<br>
&gt;<br>
&gt; <a href="http://vger.kernel.org/vger-lists.html" target="_blank">http://vger.kernel.org/vger-lists.html</a><br>
&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2011/5/31 Angus Salkeld &lt;<a href="mailto:asalkeld@redhat.com">asalkeld@redhat.com</a>&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Tue, May 31, 2011 at 06:25:56PM -0300, william felipe_welter wrote:<br>
&gt;&gt;&gt;&gt;&gt; Thanks Steven,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Now im try to run on the MCP:<br>
&gt;&gt;&gt;&gt;&gt; - Uninstall the pacemaker 1.0<br>
&gt;&gt;&gt;&gt;&gt; - Compile and install 1.1<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; But now i have problems to initialize the pacemakerd: Could not<br>
&gt;&gt;&gt;&gt; initialize<br>
&gt;&gt;&gt;&gt;&gt; Cluster Configuration Database API instance error 2<br>
&gt;&gt;&gt;&gt;&gt; Debbuging with gdb i see that the error are on the confdb.. most<br>
&gt;&gt;&gt;&gt; specificaly<br>
&gt;&gt;&gt;&gt;&gt; the errors start on coreipcc.c  at line:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; 448        if (addr != addr_orig) {<br>
&gt;&gt;&gt;&gt;&gt; 449                goto error_close_unlink;  &lt;- enter here<br>
&gt;&gt;&gt;&gt;&gt; 450       }<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Some ideia about  what can cause this  ?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I tried porting a ringbuffer (<a href="http://www.libqb.org" target="_blank">www.libqb.org</a>) to sparc and had the same<br>
&gt;&gt;&gt;&gt; failure.<br>
&gt;&gt;&gt;&gt; There are 3 mmap() calls and on sparc the third one keeps failing.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; This is a common way of creating a ring buffer, see:<br>
&gt;&gt;&gt;&gt; <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>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I couldn&#39;t get it working in the short time I tried. It&#39;s probably<br>
&gt;&gt;&gt;&gt; worth looking at the clib implementation to see why it&#39;s failing<br>
&gt;&gt;&gt;&gt; (I didn&#39;t get to that).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; -Angus<br>
&gt;&gt;&gt;&gt;<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">&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
&gt;&gt;&gt;&gt; <a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
&gt;&gt;&gt;&gt; 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>
&gt;&gt;&gt;&gt; Bugs:<br>
&gt;&gt;&gt;&gt; <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>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; William Felipe Welter<br>
&gt;&gt;&gt; ------------------------------<br>
&gt;&gt;&gt; Consultor em Tecnologias Livres<br>
&gt;&gt;&gt; <a href="mailto:william.welter@4linux.com.br">william.welter@4linux.com.br</a><br>
&gt;&gt;&gt; <a href="http://www.4linux.com.br" target="_blank">www.4linux.com.br</a><br>
&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; Openais mailing list<br>
&gt;&gt;&gt; <a href="mailto:Openais@lists.linux-foundation.org">Openais@lists.linux-foundation.org</a><br>
&gt;&gt;&gt; <a href="https://lists.linux-foundation.org/mailman/listinfo/openais" target="_blank">https://lists.linux-foundation.org/mailman/listinfo/openais</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
&gt;&gt; <a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
&gt;&gt;<br>
&gt;&gt; Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
&gt;&gt; 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>
&gt;&gt; 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>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Openais mailing list<br>
&gt; <a href="mailto:Openais@lists.linux-foundation.org">Openais@lists.linux-foundation.org</a><br>
&gt; <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>