lkml.org 
[lkml]   [2019]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v7 02/23] locking/lockdep: Fix reported required memory size (1/2)
    Date
    Change the sizeof(array element time) * (array size) expressions into
    sizeof(array). This fixes the size computations of the classhash_table[]
    and chainhash_table[] arrays. Commit a63f38cc4ccf ("locking/lockdep:
    Convert hash tables to hlists") namely changed the type of the elements
    of that array from struct list_head into struct hlist_head.

    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Waiman Long <longman@redhat.com>
    Cc: Johannes Berg <johannes@sipsolutions.net>
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    ---
    kernel/locking/lockdep.c | 14 +++++++-------
    1 file changed, 7 insertions(+), 7 deletions(-)

    diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
    index 9cdb6292b3c0..193fef487a15 100644
    --- a/kernel/locking/lockdep.c
    +++ b/kernel/locking/lockdep.c
    @@ -4279,19 +4279,19 @@ void __init lockdep_init(void)
    printk("... CHAINHASH_SIZE: %lu\n", CHAINHASH_SIZE);

    printk(" memory used by lock dependency info: %zu kB\n",
    - (sizeof(struct lock_class) * MAX_LOCKDEP_KEYS +
    - sizeof(struct list_head) * CLASSHASH_SIZE +
    - sizeof(struct lock_list) * MAX_LOCKDEP_ENTRIES +
    - sizeof(struct lock_chain) * MAX_LOCKDEP_CHAINS +
    - sizeof(struct list_head) * CHAINHASH_SIZE
    + (sizeof(lock_classes) +
    + sizeof(classhash_table) +
    + sizeof(list_entries) +
    + sizeof(lock_chains) +
    + sizeof(chainhash_table)
    #ifdef CONFIG_PROVE_LOCKING
    - + sizeof(struct circular_queue)
    + + sizeof(lock_cq)
    #endif
    ) / 1024
    );

    printk(" per task-struct memory footprint: %zu bytes\n",
    - sizeof(struct held_lock) * MAX_LOCK_DEPTH);
    + sizeof(((struct task_struct *)NULL)->held_locks));
    }

    static void
    --
    2.21.0.rc0.258.g878e2cd30e-goog
    \
     
     \ /
      Last update: 2019-02-15 00:02    [W:2.149 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site