CC: [email protected]
CC: Linux Memory Management List <[email protected]>
TO: "Paul E. McKenney" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   07f7e57c63aaa2afb4ea31edef05e08699a63a00
commit: 8e7f37f2aaa56b723a24f6872817cf9c6410b613 [4613/11103] mm: Add 
mem_dump_obj() to print source of memory block
:::::: branch date: 21 hours ago
:::::: commit date: 3 weeks ago
compiler: nds32le-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


"cppcheck warnings: (new ones prefixed by >>)"
   mm/slab.c:3309:7: warning: Redundant assignment of 'objp' to itself. 
[selfAssignment]
    objp = cache_alloc_debugcheck_after(cachep, flags, objp, caller);
         ^
   mm/slab.c:3442:7: warning: Redundant assignment of 'objp' to itself. 
[selfAssignment]
    objp = cache_free_debugcheck(cachep, objp, caller);
         ^
   mm/slab.c:3502:8: warning: Redundant assignment of 'p[i]' to itself. 
[selfAssignment]
     p[i] = cache_alloc_debugcheck_after(s, flags, p[i], caller);
          ^

cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> mm/slab.c:3880:12: warning: Same expression on both sides of '&&' because 
>> 'limit' and 'shared' represent the same value. [knownConditionTrueFalse]
    if (limit && shared && batchcount)
              ^
   mm/slab.c:3872:14: note: 'limit' is assigned value '0' here.
    int limit = 0;
                ^
   mm/slab.c:3873:15: note: 'shared' is assigned value '0' here.
    int shared = 0;
                 ^
   mm/slab.c:3880:12: note: Same expression on both sides of '&&' because 
'limit' and 'shared' represent the same value.
    if (limit && shared && batchcount)
              ^
>> mm/slab.c:3880:22: warning: Same expression on both sides of '&&' because 
>> 'batchcount' and 'shared' represent the same value. [knownConditionTrueFalse]
    if (limit && shared && batchcount)
                        ^
   mm/slab.c:3874:19: note: 'batchcount' is assigned value '0' here.
    int batchcount = 0;
                     ^
   mm/slab.c:3873:15: note: 'shared' is assigned value '0' here.
    int shared = 0;
                 ^
   mm/slab.c:3880:22: note: Same expression on both sides of '&&' because 
'batchcount' and 'shared' represent the same value.
    if (limit && shared && batchcount)
                        ^

vim +3880 mm/slab.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  3867  
18004c5d4084d9 Christoph Lameter 2012-07-06  3868  /* Called with slab_mutex 
held always */
83b519e8b9572c Pekka Enberg      2009-06-10  3869  static int 
enable_cpucache(struct kmem_cache *cachep, gfp_t gfp)
^1da177e4c3f41 Linus Torvalds    2005-04-16  3870  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  3871       int err;
943a451a87d229 Glauber Costa     2012-12-18  3872       int limit = 0;
943a451a87d229 Glauber Costa     2012-12-18  3873       int shared = 0;
943a451a87d229 Glauber Costa     2012-12-18  3874       int batchcount = 0;
943a451a87d229 Glauber Costa     2012-12-18  3875  
7c00fce98c3e15 Thomas Garnier    2016-07-26  3876       err = 
cache_random_seq_create(cachep, cachep->num, gfp);
c7ce4f60ac199f Thomas Garnier    2016-05-19  3877       if (err)
c7ce4f60ac199f Thomas Garnier    2016-05-19  3878               goto end;
c7ce4f60ac199f Thomas Garnier    2016-05-19  3879  
943a451a87d229 Glauber Costa     2012-12-18 @3880       if (limit && shared && 
batchcount)
943a451a87d229 Glauber Costa     2012-12-18  3881               goto skip_setup;
a737b3e2fcf96f Andrew Morton     2006-03-22  3882       /*
a737b3e2fcf96f Andrew Morton     2006-03-22  3883        * The head array 
serves three purposes:
^1da177e4c3f41 Linus Torvalds    2005-04-16  3884        * - create a LIFO 
ordering, i.e. return objects that are cache-warm
^1da177e4c3f41 Linus Torvalds    2005-04-16  3885        * - reduce the number 
of spinlock operations.
^1da177e4c3f41 Linus Torvalds    2005-04-16  3886        * - reduce the number 
of linked list operations on the slab and
^1da177e4c3f41 Linus Torvalds    2005-04-16  3887        *   bufctl chains: 
array operations are cheaper.
^1da177e4c3f41 Linus Torvalds    2005-04-16  3888        * The numbers are 
guessed, we should auto-tune as described by
^1da177e4c3f41 Linus Torvalds    2005-04-16  3889        * Bonwick.
^1da177e4c3f41 Linus Torvalds    2005-04-16  3890        */
3b0efdfa1e7193 Christoph Lameter 2012-06-13  3891       if (cachep->size > 
131072)
^1da177e4c3f41 Linus Torvalds    2005-04-16  3892               limit = 1;
3b0efdfa1e7193 Christoph Lameter 2012-06-13  3893       else if (cachep->size > 
PAGE_SIZE)
^1da177e4c3f41 Linus Torvalds    2005-04-16  3894               limit = 8;
3b0efdfa1e7193 Christoph Lameter 2012-06-13  3895       else if (cachep->size > 
1024)
^1da177e4c3f41 Linus Torvalds    2005-04-16  3896               limit = 24;
3b0efdfa1e7193 Christoph Lameter 2012-06-13  3897       else if (cachep->size > 
256)
^1da177e4c3f41 Linus Torvalds    2005-04-16  3898               limit = 54;
^1da177e4c3f41 Linus Torvalds    2005-04-16  3899       else
^1da177e4c3f41 Linus Torvalds    2005-04-16  3900               limit = 120;
^1da177e4c3f41 Linus Torvalds    2005-04-16  3901  
a737b3e2fcf96f Andrew Morton     2006-03-22  3902       /*
a737b3e2fcf96f Andrew Morton     2006-03-22  3903        * CPU bound tasks 
(e.g. network routing) can exhibit cpu bound
^1da177e4c3f41 Linus Torvalds    2005-04-16  3904        * allocation 
behaviour: Most allocs on one cpu, most free operations
^1da177e4c3f41 Linus Torvalds    2005-04-16  3905        * on another cpu. For 
these cases, an efficient object passing between
^1da177e4c3f41 Linus Torvalds    2005-04-16  3906        * cpus is necessary. 
This is provided by a shared array. The array
^1da177e4c3f41 Linus Torvalds    2005-04-16  3907        * replaces Bonwick's 
magazine layer.
^1da177e4c3f41 Linus Torvalds    2005-04-16  3908        * On uniprocessor, 
it's functionally equivalent (but less efficient)
^1da177e4c3f41 Linus Torvalds    2005-04-16  3909        * to a larger limit. 
Thus disabled by default.
^1da177e4c3f41 Linus Torvalds    2005-04-16  3910        */
^1da177e4c3f41 Linus Torvalds    2005-04-16  3911       shared = 0;
3b0efdfa1e7193 Christoph Lameter 2012-06-13  3912       if (cachep->size <= 
PAGE_SIZE && num_possible_cpus() > 1)
^1da177e4c3f41 Linus Torvalds    2005-04-16  3913               shared = 8;
^1da177e4c3f41 Linus Torvalds    2005-04-16  3914  

:::::: The code at line 3880 was first introduced by commit
:::::: 943a451a87d229ca564a27274b58eaeae35fde5d slab: propagate tunable values

:::::: TO: Glauber Costa <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to