[Bugs] [Bug 1724210] New: Incorrect power of two calculation in mem_pool_get_fn

bugzilla at redhat.com bugzilla at redhat.com
Wed Jun 26 13:20:32 UTC 2019


https://bugzilla.redhat.com/show_bug.cgi?id=1724210

            Bug ID: 1724210
           Summary: Incorrect power of two calculation in mem_pool_get_fn
           Product: GlusterFS
           Version: 6
            Status: NEW
         Component: core
          Assignee: bugs at gluster.org
          Reporter: jahernan at redhat.com
                CC: atumball at redhat.com, bugs at gluster.org,
                    nbalacha at redhat.com, rhinduja at redhat.com,
                    rhs-bugs at redhat.com, sankarshan at redhat.com,
                    storage-qa-internal at redhat.com
        Depends On: 1722801, 1722802
  Target Milestone: ---
    Classification: Community



+++ This bug was initially created as a clone of Bug #1722802 +++

+++ This bug was initially created as a clone of Bug #1722801 +++

Description of problem:

The method used to calculate the power of two value for a type is off by 1
causing twice the required amount of memory to be allocated.
For example, cComparing the information for inode_t in statedumps from 3.4.4
and 3.5.0:

3.4.4:
------

pool-name=inode_t                                                               
active-count=15408                                                              
sizeof-type=168                                                                 
padded-sizeof=256                                                               
size=3944448                                                                    
shared-pool=0x7fac27a7b468                                                      
-----=-----                



3.5.0:
------
pool-name=inode_t                                                               
active-count=2                                                                  
sizeof-type=255     <--- actual sizeof inode_t is 168                           
padded-sizeof=512   <--- padded size is twice the required amount               
size=1024                                                                       
shared-pool=0x7f1103b5b6d0





Version-Release number of selected component (if applicable):
3.5.0

How reproducible:


Steps to Reproduce:
1. Create volume, fuse mount it and create some files and dirs on it
2. Take a statedump of the gluster mount process (kill -SIGUSR1 <pid>)
3. Compare the sizeof-type and padded-sizeof values in the state releases.

Actual results:
The padded-sizeof is twice the smallest power of two value for sizeof-type +
sizeof(obj header)

Expected results:

The padded-sizeof should be the smallest power of two value for sizeof-type +
sizeof(obj header)


Additional info:


Referenced Bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1722801
[Bug 1722801] Incorrect power of two calculation in mem_pool_get_fn
https://bugzilla.redhat.com/show_bug.cgi?id=1722802
[Bug 1722802] Incorrect power of two calculation in mem_pool_get_fn
-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list