From: kernel test robot <lkp@intel.com>
To: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Linux Memory Management List <linux-mm@kvack.org>,
Theodore Ts'o <tytso@mit.edu>, Andreas Dilger <adilger@dilger.ca>
Subject: [linux-next:master 10419/14048] fs/ext4/mballoc.c:2614:1: warning: stack frame size of 2416 bytes in function 'ext4_mb_regular_allocator'
Date: Tue, 20 Apr 2021 21:15:27 +0800 [thread overview]
Message-ID: <202104202112.1Cba8V4g-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 24094 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 593ef1658ecf61d3619885bdbbcfffa3d1417891
commit: 196e402adf2e4cd66f101923409f1970ec5f1af3 [10419/14048] ext4: improve cr 0 / cr 1 group scanning
config: powerpc-randconfig-r036-20210420 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project ca8eef7e3da8f750d7c7aa004fe426d1d34787ea)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=196e402adf2e4cd66f101923409f1970ec5f1af3
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 196e402adf2e4cd66f101923409f1970ec5f1af3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:63:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from fs/ext4/mballoc.c:12:
In file included from fs/ext4/ext4_jbd2.h:16:
In file included from include/linux/jbd2.h:23:
In file included from include/linux/buffer_head.h:14:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:65:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from fs/ext4/mballoc.c:12:
In file included from fs/ext4/ext4_jbd2.h:16:
In file included from include/linux/jbd2.h:23:
In file included from include/linux/buffer_head.h:14:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:67:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from fs/ext4/mballoc.c:12:
In file included from fs/ext4/ext4_jbd2.h:16:
In file included from include/linux/jbd2.h:23:
In file included from include/linux/buffer_head.h:14:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:69:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from fs/ext4/mballoc.c:12:
In file included from fs/ext4/ext4_jbd2.h:16:
In file included from include/linux/jbd2.h:23:
In file included from include/linux/buffer_head.h:14:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:71:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
>> fs/ext4/mballoc.c:2614:1: warning: stack frame size of 2416 bytes in function 'ext4_mb_regular_allocator' [-Wframe-larger-than=]
ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
^
13 warnings generated.
vim +/ext4_mb_regular_allocator +2614 fs/ext4/mballoc.c
cfd73237722135 Alex Zhuravlev 2020-04-21 2612
4ddfef7b41aebb Eric Sandeen 2008-04-29 2613 static noinline_for_stack int
4ddfef7b41aebb Eric Sandeen 2008-04-29 @2614 ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
c9de560ded61fa Alex Tomas 2008-01-29 2615 {
cfd73237722135 Alex Zhuravlev 2020-04-21 2616 ext4_group_t prefetch_grp = 0, ngroups, group, i;
bbc4ec77e9f9c7 Ritesh Harjani 2020-05-10 2617 int cr = -1;
42ac1848eac588 Lukas Czerner 2015-06-08 2618 int err = 0, first_err = 0;
cfd73237722135 Alex Zhuravlev 2020-04-21 2619 unsigned int nr = 0, prefetch_ios = 0;
c9de560ded61fa Alex Tomas 2008-01-29 2620 struct ext4_sb_info *sbi;
c9de560ded61fa Alex Tomas 2008-01-29 2621 struct super_block *sb;
c9de560ded61fa Alex Tomas 2008-01-29 2622 struct ext4_buddy e4b;
66d5e0277e225c brookxu 2020-08-17 2623 int lost;
c9de560ded61fa Alex Tomas 2008-01-29 2624
c9de560ded61fa Alex Tomas 2008-01-29 2625 sb = ac->ac_sb;
c9de560ded61fa Alex Tomas 2008-01-29 2626 sbi = EXT4_SB(sb);
8df9675f8b498d Theodore Ts'o 2009-05-01 2627 ngroups = ext4_get_groups_count(sb);
fb0a387dcdcd21 Eric Sandeen 2009-09-16 2628 /* non-extent files are limited to low blocks/groups */
12e9b892002d9a Dmitry Monakhov 2010-05-16 2629 if (!(ext4_test_inode_flag(ac->ac_inode, EXT4_INODE_EXTENTS)))
fb0a387dcdcd21 Eric Sandeen 2009-09-16 2630 ngroups = sbi->s_blockfile_groups;
fb0a387dcdcd21 Eric Sandeen 2009-09-16 2631
c9de560ded61fa Alex Tomas 2008-01-29 2632 BUG_ON(ac->ac_status == AC_STATUS_FOUND);
c9de560ded61fa Alex Tomas 2008-01-29 2633
c9de560ded61fa Alex Tomas 2008-01-29 2634 /* first, try the goal */
c9de560ded61fa Alex Tomas 2008-01-29 2635 err = ext4_mb_find_by_goal(ac, &e4b);
c9de560ded61fa Alex Tomas 2008-01-29 2636 if (err || ac->ac_status == AC_STATUS_FOUND)
c9de560ded61fa Alex Tomas 2008-01-29 2637 goto out;
c9de560ded61fa Alex Tomas 2008-01-29 2638
c9de560ded61fa Alex Tomas 2008-01-29 2639 if (unlikely(ac->ac_flags & EXT4_MB_HINT_GOAL_ONLY))
c9de560ded61fa Alex Tomas 2008-01-29 2640 goto out;
c9de560ded61fa Alex Tomas 2008-01-29 2641
c9de560ded61fa Alex Tomas 2008-01-29 2642 /*
e9a3cd48d65307 brookxu 2020-08-07 2643 * ac->ac_2order is set only if the fe_len is a power of 2
e9a3cd48d65307 brookxu 2020-08-07 2644 * if ac->ac_2order is set we also set criteria to 0 so that we
c9de560ded61fa Alex Tomas 2008-01-29 2645 * try exact allocation using buddy.
c9de560ded61fa Alex Tomas 2008-01-29 2646 */
c9de560ded61fa Alex Tomas 2008-01-29 2647 i = fls(ac->ac_g_ex.fe_len);
c9de560ded61fa Alex Tomas 2008-01-29 2648 ac->ac_2order = 0;
c9de560ded61fa Alex Tomas 2008-01-29 2649 /*
c9de560ded61fa Alex Tomas 2008-01-29 2650 * We search using buddy data only if the order of the request
c9de560ded61fa Alex Tomas 2008-01-29 2651 * is greater than equal to the sbi_s_mb_order2_reqs
b713a5ec55bf73 Theodore Ts'o 2009-03-31 2652 * You can tune it via /sys/fs/ext4/<partition>/mb_order2_req
d9b22cf9f5466a Jan Kara 2017-02-10 2653 * We also support searching for power-of-two requests only for
d9b22cf9f5466a Jan Kara 2017-02-10 2654 * requests upto maximum buddy size we have constructed.
c9de560ded61fa Alex Tomas 2008-01-29 2655 */
4b68f6df105966 Harshad Shirwadkar 2021-04-01 2656 if (i >= sbi->s_mb_order2_reqs && i <= MB_NUM_ORDERS(sb)) {
c9de560ded61fa Alex Tomas 2008-01-29 2657 /*
c9de560ded61fa Alex Tomas 2008-01-29 2658 * This should tell if fe_len is exactly power of 2
c9de560ded61fa Alex Tomas 2008-01-29 2659 */
c9de560ded61fa Alex Tomas 2008-01-29 2660 if ((ac->ac_g_ex.fe_len & (~(1 << (i - 1)))) == 0)
1a5d5e5d51e75a Jeremy Cline 2018-08-02 2661 ac->ac_2order = array_index_nospec(i - 1,
4b68f6df105966 Harshad Shirwadkar 2021-04-01 2662 MB_NUM_ORDERS(sb));
c9de560ded61fa Alex Tomas 2008-01-29 2663 }
c9de560ded61fa Alex Tomas 2008-01-29 2664
4ba74d00a20256 Theodore Ts'o 2009-08-09 2665 /* if stream allocation is enabled, use global goal */
4ba74d00a20256 Theodore Ts'o 2009-08-09 2666 if (ac->ac_flags & EXT4_MB_STREAM_ALLOC) {
c9de560ded61fa Alex Tomas 2008-01-29 2667 /* TBD: may be hot point */
c9de560ded61fa Alex Tomas 2008-01-29 2668 spin_lock(&sbi->s_md_lock);
c9de560ded61fa Alex Tomas 2008-01-29 2669 ac->ac_g_ex.fe_group = sbi->s_mb_last_group;
c9de560ded61fa Alex Tomas 2008-01-29 2670 ac->ac_g_ex.fe_start = sbi->s_mb_last_start;
c9de560ded61fa Alex Tomas 2008-01-29 2671 spin_unlock(&sbi->s_md_lock);
c9de560ded61fa Alex Tomas 2008-01-29 2672 }
4ba74d00a20256 Theodore Ts'o 2009-08-09 2673
c9de560ded61fa Alex Tomas 2008-01-29 2674 /* Let's just scan groups to find more-less suitable blocks */
c9de560ded61fa Alex Tomas 2008-01-29 2675 cr = ac->ac_2order ? 0 : 1;
c9de560ded61fa Alex Tomas 2008-01-29 2676 /*
c9de560ded61fa Alex Tomas 2008-01-29 2677 * cr == 0 try to get exact allocation,
c9de560ded61fa Alex Tomas 2008-01-29 2678 * cr == 3 try to get anything
c9de560ded61fa Alex Tomas 2008-01-29 2679 */
c9de560ded61fa Alex Tomas 2008-01-29 2680 repeat:
c9de560ded61fa Alex Tomas 2008-01-29 2681 for (; cr < 4 && ac->ac_status == AC_STATUS_CONTINUE; cr++) {
c9de560ded61fa Alex Tomas 2008-01-29 2682 ac->ac_criteria = cr;
ed8f9c751feb3a Aneesh Kumar K.V 2008-07-11 2683 /*
ed8f9c751feb3a Aneesh Kumar K.V 2008-07-11 2684 * searching for the right group start
ed8f9c751feb3a Aneesh Kumar K.V 2008-07-11 2685 * from the goal value specified
ed8f9c751feb3a Aneesh Kumar K.V 2008-07-11 2686 */
ed8f9c751feb3a Aneesh Kumar K.V 2008-07-11 2687 group = ac->ac_g_ex.fe_group;
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2688 ac->ac_last_optimal_group = group;
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2689 ac->ac_groups_linear_remaining = sbi->s_mb_max_linear_groups;
cfd73237722135 Alex Zhuravlev 2020-04-21 2690 prefetch_grp = group;
ed8f9c751feb3a Aneesh Kumar K.V 2008-07-11 2691
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2692 for (i = 0; i < ngroups; group = next_linear_group(ac, group, ngroups),
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2693 i++) {
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2694 int ret = 0, new_cr;
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2695
2ed5724d5a78a2 Theodore Ts'o 2013-06-12 2696 cond_resched();
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2697
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2698 ext4_mb_choose_next_group(ac, &new_cr, &group, ngroups);
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2699 if (new_cr != cr) {
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2700 cr = new_cr;
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2701 goto repeat;
196e402adf2e4c Harshad Shirwadkar 2021-04-01 2702 }
c9de560ded61fa Alex Tomas 2008-01-29 2703
cfd73237722135 Alex Zhuravlev 2020-04-21 2704 /*
cfd73237722135 Alex Zhuravlev 2020-04-21 2705 * Batch reads of the block allocation bitmaps
cfd73237722135 Alex Zhuravlev 2020-04-21 2706 * to get multiple READs in flight; limit
cfd73237722135 Alex Zhuravlev 2020-04-21 2707 * prefetching at cr=0/1, otherwise mballoc can
cfd73237722135 Alex Zhuravlev 2020-04-21 2708 * spend a lot of time loading imperfect groups
cfd73237722135 Alex Zhuravlev 2020-04-21 2709 */
cfd73237722135 Alex Zhuravlev 2020-04-21 2710 if ((prefetch_grp == group) &&
cfd73237722135 Alex Zhuravlev 2020-04-21 2711 (cr > 1 ||
cfd73237722135 Alex Zhuravlev 2020-04-21 2712 prefetch_ios < sbi->s_mb_prefetch_limit)) {
cfd73237722135 Alex Zhuravlev 2020-04-21 2713 unsigned int curr_ios = prefetch_ios;
cfd73237722135 Alex Zhuravlev 2020-04-21 2714
cfd73237722135 Alex Zhuravlev 2020-04-21 2715 nr = sbi->s_mb_prefetch;
cfd73237722135 Alex Zhuravlev 2020-04-21 2716 if (ext4_has_feature_flex_bg(sb)) {
82ef1370b0c175 Chunguang Xu 2020-12-04 2717 nr = 1 << sbi->s_log_groups_per_flex;
82ef1370b0c175 Chunguang Xu 2020-12-04 2718 nr -= group & (nr - 1);
82ef1370b0c175 Chunguang Xu 2020-12-04 2719 nr = min(nr, sbi->s_mb_prefetch);
cfd73237722135 Alex Zhuravlev 2020-04-21 2720 }
cfd73237722135 Alex Zhuravlev 2020-04-21 2721 prefetch_grp = ext4_mb_prefetch(sb, group,
cfd73237722135 Alex Zhuravlev 2020-04-21 2722 nr, &prefetch_ios);
cfd73237722135 Alex Zhuravlev 2020-04-21 2723 if (prefetch_ios == curr_ios)
cfd73237722135 Alex Zhuravlev 2020-04-21 2724 nr = 0;
cfd73237722135 Alex Zhuravlev 2020-04-21 2725 }
cfd73237722135 Alex Zhuravlev 2020-04-21 2726
8a57d9d61a6e36 Curt Wohlgemuth 2010-05-16 2727 /* This now checks without needing the buddy page */
8ef123fe02ca09 Ritesh Harjani 2020-05-20 2728 ret = ext4_mb_good_group_nolock(ac, group, cr);
42ac1848eac588 Lukas Czerner 2015-06-08 2729 if (ret <= 0) {
42ac1848eac588 Lukas Czerner 2015-06-08 2730 if (!first_err)
42ac1848eac588 Lukas Czerner 2015-06-08 2731 first_err = ret;
c9de560ded61fa Alex Tomas 2008-01-29 2732 continue;
42ac1848eac588 Lukas Czerner 2015-06-08 2733 }
c9de560ded61fa Alex Tomas 2008-01-29 2734
c9de560ded61fa Alex Tomas 2008-01-29 2735 err = ext4_mb_load_buddy(sb, group, &e4b);
c9de560ded61fa Alex Tomas 2008-01-29 2736 if (err)
c9de560ded61fa Alex Tomas 2008-01-29 2737 goto out;
c9de560ded61fa Alex Tomas 2008-01-29 2738
c9de560ded61fa Alex Tomas 2008-01-29 2739 ext4_lock_group(sb, group);
8a57d9d61a6e36 Curt Wohlgemuth 2010-05-16 2740
8a57d9d61a6e36 Curt Wohlgemuth 2010-05-16 2741 /*
8a57d9d61a6e36 Curt Wohlgemuth 2010-05-16 2742 * We need to check again after locking the
8a57d9d61a6e36 Curt Wohlgemuth 2010-05-16 2743 * block group
8a57d9d61a6e36 Curt Wohlgemuth 2010-05-16 2744 */
42ac1848eac588 Lukas Czerner 2015-06-08 2745 ret = ext4_mb_good_group(ac, group, cr);
8ef123fe02ca09 Ritesh Harjani 2020-05-20 2746 if (ret == 0) {
c9de560ded61fa Alex Tomas 2008-01-29 2747 ext4_unlock_group(sb, group);
e39e07fdfd98be Jing Zhang 2010-05-14 2748 ext4_mb_unload_buddy(&e4b);
c9de560ded61fa Alex Tomas 2008-01-29 2749 continue;
c9de560ded61fa Alex Tomas 2008-01-29 2750 }
c9de560ded61fa Alex Tomas 2008-01-29 2751
c9de560ded61fa Alex Tomas 2008-01-29 2752 ac->ac_groups_scanned++;
d9b22cf9f5466a Jan Kara 2017-02-10 2753 if (cr == 0)
c9de560ded61fa Alex Tomas 2008-01-29 2754 ext4_mb_simple_scan_group(ac, &e4b);
506bf2d82165c0 Eric Sandeen 2010-07-27 2755 else if (cr == 1 && sbi->s_stripe &&
506bf2d82165c0 Eric Sandeen 2010-07-27 2756 !(ac->ac_g_ex.fe_len % sbi->s_stripe))
c9de560ded61fa Alex Tomas 2008-01-29 2757 ext4_mb_scan_aligned(ac, &e4b);
c9de560ded61fa Alex Tomas 2008-01-29 2758 else
c9de560ded61fa Alex Tomas 2008-01-29 2759 ext4_mb_complex_scan_group(ac, &e4b);
c9de560ded61fa Alex Tomas 2008-01-29 2760
c9de560ded61fa Alex Tomas 2008-01-29 2761 ext4_unlock_group(sb, group);
e39e07fdfd98be Jing Zhang 2010-05-14 2762 ext4_mb_unload_buddy(&e4b);
c9de560ded61fa Alex Tomas 2008-01-29 2763
c9de560ded61fa Alex Tomas 2008-01-29 2764 if (ac->ac_status != AC_STATUS_CONTINUE)
c9de560ded61fa Alex Tomas 2008-01-29 2765 break;
c9de560ded61fa Alex Tomas 2008-01-29 2766 }
a6c75eaf11032f Harshad Shirwadkar 2021-04-01 2767 /* Processed all groups and haven't found blocks */
a6c75eaf11032f Harshad Shirwadkar 2021-04-01 2768 if (sbi->s_mb_stats && i == ngroups)
a6c75eaf11032f Harshad Shirwadkar 2021-04-01 2769 atomic64_inc(&sbi->s_bal_cX_failed[cr]);
c9de560ded61fa Alex Tomas 2008-01-29 2770 }
c9de560ded61fa Alex Tomas 2008-01-29 2771
c9de560ded61fa Alex Tomas 2008-01-29 2772 if (ac->ac_b_ex.fe_len > 0 && ac->ac_status != AC_STATUS_FOUND &&
c9de560ded61fa Alex Tomas 2008-01-29 2773 !(ac->ac_flags & EXT4_MB_HINT_FIRST)) {
c9de560ded61fa Alex Tomas 2008-01-29 2774 /*
c9de560ded61fa Alex Tomas 2008-01-29 2775 * We've been searching too long. Let's try to allocate
c9de560ded61fa Alex Tomas 2008-01-29 2776 * the best chunk we've found so far
c9de560ded61fa Alex Tomas 2008-01-29 2777 */
c9de560ded61fa Alex Tomas 2008-01-29 2778 ext4_mb_try_best_found(ac, &e4b);
c9de560ded61fa Alex Tomas 2008-01-29 2779 if (ac->ac_status != AC_STATUS_FOUND) {
c9de560ded61fa Alex Tomas 2008-01-29 2780 /*
c9de560ded61fa Alex Tomas 2008-01-29 2781 * Someone more lucky has already allocated it.
c9de560ded61fa Alex Tomas 2008-01-29 2782 * The only thing we can do is just take first
c9de560ded61fa Alex Tomas 2008-01-29 2783 * found block(s)
c9de560ded61fa Alex Tomas 2008-01-29 2784 */
66d5e0277e225c brookxu 2020-08-17 2785 lost = atomic_inc_return(&sbi->s_mb_lost_chunks);
66d5e0277e225c brookxu 2020-08-17 2786 mb_debug(sb, "lost chunk, group: %u, start: %d, len: %d, lost: %d\n",
c55ee7d202857b brookxu 2020-08-15 2787 ac->ac_b_ex.fe_group, ac->ac_b_ex.fe_start,
c55ee7d202857b brookxu 2020-08-15 2788 ac->ac_b_ex.fe_len, lost);
c55ee7d202857b brookxu 2020-08-15 2789
c9de560ded61fa Alex Tomas 2008-01-29 2790 ac->ac_b_ex.fe_group = 0;
c9de560ded61fa Alex Tomas 2008-01-29 2791 ac->ac_b_ex.fe_start = 0;
c9de560ded61fa Alex Tomas 2008-01-29 2792 ac->ac_b_ex.fe_len = 0;
c9de560ded61fa Alex Tomas 2008-01-29 2793 ac->ac_status = AC_STATUS_CONTINUE;
c9de560ded61fa Alex Tomas 2008-01-29 2794 ac->ac_flags |= EXT4_MB_HINT_FIRST;
c9de560ded61fa Alex Tomas 2008-01-29 2795 cr = 3;
c9de560ded61fa Alex Tomas 2008-01-29 2796 goto repeat;
c9de560ded61fa Alex Tomas 2008-01-29 2797 }
c9de560ded61fa Alex Tomas 2008-01-29 2798 }
a6c75eaf11032f Harshad Shirwadkar 2021-04-01 2799
a6c75eaf11032f Harshad Shirwadkar 2021-04-01 2800 if (sbi->s_mb_stats && ac->ac_status == AC_STATUS_FOUND)
a6c75eaf11032f Harshad Shirwadkar 2021-04-01 2801 atomic64_inc(&sbi->s_bal_cX_hits[ac->ac_criteria]);
c9de560ded61fa Alex Tomas 2008-01-29 2802 out:
42ac1848eac588 Lukas Czerner 2015-06-08 2803 if (!err && ac->ac_status != AC_STATUS_FOUND && first_err)
42ac1848eac588 Lukas Czerner 2015-06-08 2804 err = first_err;
bbc4ec77e9f9c7 Ritesh Harjani 2020-05-10 2805
d3df14535f4a5b Ritesh Harjani 2020-05-10 2806 mb_debug(sb, "Best len %d, origin len %d, ac_status %u, ac_flags 0x%x, cr %d ret %d\n",
bbc4ec77e9f9c7 Ritesh Harjani 2020-05-10 2807 ac->ac_b_ex.fe_len, ac->ac_o_ex.fe_len, ac->ac_status,
bbc4ec77e9f9c7 Ritesh Harjani 2020-05-10 2808 ac->ac_flags, cr, err);
cfd73237722135 Alex Zhuravlev 2020-04-21 2809
cfd73237722135 Alex Zhuravlev 2020-04-21 2810 if (nr)
cfd73237722135 Alex Zhuravlev 2020-04-21 2811 ext4_mb_prefetch_fini(sb, prefetch_grp, nr);
cfd73237722135 Alex Zhuravlev 2020-04-21 2812
c9de560ded61fa Alex Tomas 2008-01-29 2813 return err;
c9de560ded61fa Alex Tomas 2008-01-29 2814 }
c9de560ded61fa Alex Tomas 2008-01-29 2815
:::::: The code at line 2614 was first introduced by commit
:::::: 4ddfef7b41aebbbede73f361cb938800ba3072dc ext4: reduce mballoc stack usage with noinline_for_stack
:::::: TO: Eric Sandeen <sandeen@redhat.com>
:::::: CC: Theodore Ts'o <tytso@mit.edu>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23539 bytes --]
reply other threads:[~2021-04-20 13:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202104202112.1Cba8V4g-lkp@intel.com \
--to=lkp@intel.com \
--cc=adilger@dilger.ca \
--cc=clang-built-linux@googlegroups.com \
--cc=harshadshirwadkar@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).