1. 11 Mar, 2022 1 commit
  2. 10 Mar, 2022 1 commit
  3. 04 Mar, 2022 3 commits
    • Jaegeuk Kim's avatar
      f2fs: introduce F2FS_UNFAIR_RWSEM to support unfair rwsem · 7f8e249d
      Jaegeuk Kim authored
      Unfair rwsem should be used when blk-cg is on. Otherwise, there is regression.
      
      FYI, we noticed a -26.7% regression of aim7.jobs-per-min due to commit:
      
      commit: e4544b63 ("f2fs: move f2fs to use reader-unfair rwsems")
      https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
      
      in testcase: aim7
      on test machine: 88 threads 2 sockets Intel(R) Xeon(R) Gold 6238M CPU @ 2.10GHz with 128G memory
      with following parameters:
      
      	disk: 4BRD_12G
      	md: RAID0
      	fs: f2fs
      	test: sync_disk_rw
      	load: 100
      	cpufreq_governor: performance
      	ucode: 0x500320a
      
      test-description: AIM7 is a traditional UNIX system level benchmark suite which is used to test and measure the performance of multiuser system.
      test-url: https://sourceforge.net/projects/aimbench/files/aim-suite7/Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Reviewed-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      7f8e249d
    • Jaegeuk Kim's avatar
      f2fs: avoid an infinite loop in f2fs_sync_dirty_inodes · 50c63009
      Jaegeuk Kim authored
      If one read IO is always failing, we can fall into an infinite loop in
      f2fs_sync_dirty_inodes. This happens during xfstests/generic/475.
      
      [  142.803335] Buffer I/O error on dev dm-1, logical block 8388592, async page read
      ...
      [  382.887210]  submit_bio_noacct+0xdd/0x2a0
      [  382.887213]  submit_bio+0x80/0x110
      [  382.887223]  __submit_bio+0x4d/0x300 [f2fs]
      [  382.887282]  f2fs_submit_page_bio+0x125/0x200 [f2fs]
      [  382.887299]  __get_meta_page+0xc9/0x280 [f2fs]
      [  382.887315]  f2fs_get_meta_page+0x13/0x20 [f2fs]
      [  382.887331]  f2fs_get_node_info+0x317/0x3c0 [f2fs]
      [  382.887350]  f2fs_do_write_data_page+0x327/0x6f0 [f2fs]
      [  382.887367]  f2fs_write_single_data_page+0x5b7/0x960 [f2fs]
      [  382.887386]  f2fs_write_cache_pages+0x302/0x890 [f2fs]
      [  382.887405]  ? preempt_count_add+0x7a/0xc0
      [  382.887408]  f2fs_write_data_pages+0xfd/0x320 [f2fs]
      [  382.887425]  ? _raw_spin_unlock+0x1a/0x30
      [  382.887428]  do_writepages+0xd3/0x1d0
      [  382.887432]  filemap_fdatawrite_wbc+0x69/0x90
      [  382.887434]  filemap_fdatawrite+0x50/0x70
      [  382.887437]  f2fs_sync_dirty_inodes+0xa4/0x270 [f2fs]
      [  382.887453]  f2fs_write_checkpoint+0x189/0x1640 [f2fs]
      [  382.887469]  ? schedule_timeout+0x114/0x150
      [  382.887471]  ? ttwu_do_activate+0x6d/0xb0
      [  382.887473]  ? preempt_count_add+0x7a/0xc0
      [  382.887476]  kill_f2fs_super+0xca/0x100 [f2fs]
      [  382.887491]  deactivate_locked_super+0x35/0xa0
      [  382.887494]  deactivate_super+0x40/0x50
      [  382.887497]  cleanup_mnt+0x139/0x190
      [  382.887499]  __cleanup_mnt+0x12/0x20
      [  382.887501]  task_work_run+0x64/0xa0
      [  382.887505]  exit_to_user_mode_prepare+0x1b7/0x1c0
      [  382.887508]  syscall_exit_to_user_mode+0x27/0x50
      [  382.887510]  do_syscall_64+0x48/0xc0
      [  382.887513]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      Reviewed-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      50c63009
    • Chao Yu's avatar
      f2fs: fix to do sanity check on curseg->alloc_type · f41ee8b9
      Chao Yu authored
      As Wenqing Liu reported in bugzilla:
      
      https://bugzilla.kernel.org/show_bug.cgi?id=215657
      
      - Overview
      UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2 when mount and operate a corrupted image
      
      - Reproduce
      tested on kernel 5.17-rc4, 5.17-rc6
      
      1. mkdir test_crash
      2. cd test_crash
      3. unzip tmp2.zip
      4. mkdir mnt
      5. ./single_test.sh f2fs 2
      
      - Kernel dump
      [   46.434454] loop0: detected capacity change from 0 to 131072
      [   46.529839] F2FS-fs (loop0): Mounted with checkpoint version = 7548c2d9
      [   46.738319] ================================================================================
      [   46.738412] UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2
      [   46.738475] index 231 is out of range for type 'unsigned int [2]'
      [   46.738539] CPU: 2 PID: 939 Comm: umount Not tainted 5.17.0-rc6 #1
      [   46.738547] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014
      [   46.738551] Call Trace:
      [   46.738556]  <TASK>
      [   46.738563]  dump_stack_lvl+0x47/0x5c
      [   46.738581]  ubsan_epilogue+0x5/0x50
      [   46.738592]  __ubsan_handle_out_of_bounds+0x68/0x80
      [   46.738604]  f2fs_allocate_data_block+0xdff/0xe60 [f2fs]
      [   46.738819]  do_write_page+0xef/0x210 [f2fs]
      [   46.738934]  f2fs_do_write_node_page+0x3f/0x80 [f2fs]
      [   46.739038]  __write_node_page+0x2b7/0x920 [f2fs]
      [   46.739162]  f2fs_sync_node_pages+0x943/0xb00 [f2fs]
      [   46.739293]  f2fs_write_checkpoint+0x7bb/0x1030 [f2fs]
      [   46.739405]  kill_f2fs_super+0x125/0x150 [f2fs]
      [   46.739507]  deactivate_locked_super+0x60/0xc0
      [   46.739517]  deactivate_super+0x70/0xb0
      [   46.739524]  cleanup_mnt+0x11a/0x200
      [   46.739532]  __cleanup_mnt+0x16/0x20
      [   46.739538]  task_work_run+0x67/0xa0
      [   46.739547]  exit_to_user_mode_prepare+0x18c/0x1a0
      [   46.739559]  syscall_exit_to_user_mode+0x26/0x40
      [   46.739568]  do_syscall_64+0x46/0xb0
      [   46.739584]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      The root cause is we missed to do sanity check on curseg->alloc_type,
      result in out-of-bound accessing on sbi->block_count[] array, fix it.
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      f41ee8b9
  4. 03 Mar, 2022 1 commit
    • Chao Yu's avatar
      f2fs: fix to avoid potential deadlock · 34415099
      Chao Yu authored
      Quoted from Jing Xia's report, there is a potential deadlock may happen
      between kworker and checkpoint as below:
      
      [T:writeback]				[T:checkpoint]
      - wb_writeback
       - blk_start_plug
      bio contains NodeA was plugged in writeback threads
      					- do_writepages  -- sync write inodeB, inc wb_sync_req[DATA]
      					 - f2fs_write_data_pages
      					  - f2fs_write_single_data_page -- write last dirty page
      					   - f2fs_do_write_data_page
      					    - set_page_writeback  -- clear page dirty flag and
      					    PAGECACHE_TAG_DIRTY tag in radix tree
      					    - f2fs_outplace_write_data
      					     - f2fs_update_data_blkaddr
      					      - f2fs_wait_on_page_writeback -- wait NodeA to writeback here
      					   - inode_dec_dirty_pages
       - writeback_sb_inodes
        - writeback_single_inode
         - do_writepages
          - f2fs_write_data_pages -- skip writepages due to wb_sync_req[DATA]
           - wbc->pages_skipped += get_dirty_pages() -- PAGECACHE_TAG_DIRTY is not set but get_dirty_pages() returns one
        - requeue_inode -- requeue inode to wb->b_dirty queue due to non-zero.pages_skipped
       - blk_finish_plug
      
      Let's try to avoid deadlock condition by forcing unplugging previous bio via
      blk_finish_plug(current->plug) once we'v skipped writeback in writepages()
      due to valid sbi->wb_sync_req[DATA/NODE].
      
      Fixes: 687de7f1 ("f2fs: avoid IO split due to mixed WB_SYNC_ALL and WB_SYNC_NONE")
      Signed-off-by: default avatarZhiguo Niu <zhiguo.niu@unisoc.com>
      Signed-off-by: default avatarJing Xia <jing.xia@unisoc.com>
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      34415099
  5. 25 Feb, 2022 3 commits
    • Juhyung Park's avatar
      f2fs: quota: fix loop condition at f2fs_quota_sync() · 680af5b8
      Juhyung Park authored
      cnt should be passed to sb_has_quota_active() instead of type to check
      active quota properly.
      
      Moreover, when the type is -1, the compiler with enough inline knowledge
      can discard sb_has_quota_active() check altogether, causing a NULL pointer
      dereference at the following inode_lock(dqopt->files[cnt]):
      
      [    2.796010] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000a0
      [    2.796024] Mem abort info:
      [    2.796025]   ESR = 0x96000005
      [    2.796028]   EC = 0x25: DABT (current EL), IL = 32 bits
      [    2.796029]   SET = 0, FnV = 0
      [    2.796031]   EA = 0, S1PTW = 0
      [    2.796032] Data abort info:
      [    2.796034]   ISV = 0, ISS = 0x00000005
      [    2.796035]   CM = 0, WnR = 0
      [    2.796046] user pgtable: 4k pages, 39-bit VAs, pgdp=00000003370d1000
      [    2.796048] [00000000000000a0] pgd=0000000000000000, pud=0000000000000000
      [    2.796051] Internal error: Oops: 96000005 [#1] PREEMPT SMP
      [    2.796056] CPU: 7 PID: 640 Comm: f2fs_ckpt-259:7 Tainted: G S                5.4.179-arter97-r8-64666-g2f16e087f9d8 #1
      [    2.796057] Hardware name: Qualcomm Technologies, Inc. Lahaina MTP lemonadep (DT)
      [    2.796059] pstate: 80c00005 (Nzcv daif +PAN +UAO)
      [    2.796065] pc : down_write+0x28/0x70
      [    2.796070] lr : f2fs_quota_sync+0x100/0x294
      [    2.796071] sp : ffffffa3f48ffc30
      [    2.796073] x29: ffffffa3f48ffc30 x28: 0000000000000000
      [    2.796075] x27: ffffffa3f6d718b8 x26: ffffffa415fe9d80
      [    2.796077] x25: ffffffa3f7290048 x24: 0000000000000001
      [    2.796078] x23: 0000000000000000 x22: ffffffa3f7290000
      [    2.796080] x21: ffffffa3f72904a0 x20: ffffffa3f7290110
      [    2.796081] x19: ffffffa3f77a9800 x18: ffffffc020aae038
      [    2.796083] x17: ffffffa40e38e040 x16: ffffffa40e38e6d0
      [    2.796085] x15: ffffffa40e38e6cc x14: ffffffa40e38e6d0
      [    2.796086] x13: 00000000000004f6 x12: 00162c44ff493000
      [    2.796088] x11: 0000000000000400 x10: ffffffa40e38c948
      [    2.796090] x9 : 0000000000000000 x8 : 00000000000000a0
      [    2.796091] x7 : 0000000000000000 x6 : 0000d1060f00002a
      [    2.796093] x5 : ffffffa3f48ff718 x4 : 000000000000000d
      [    2.796094] x3 : 00000000060c0000 x2 : 0000000000000001
      [    2.796096] x1 : 0000000000000000 x0 : 00000000000000a0
      [    2.796098] Call trace:
      [    2.796100]  down_write+0x28/0x70
      [    2.796102]  f2fs_quota_sync+0x100/0x294
      [    2.796104]  block_operations+0x120/0x204
      [    2.796106]  f2fs_write_checkpoint+0x11c/0x520
      [    2.796107]  __checkpoint_and_complete_reqs+0x7c/0xd34
      [    2.796109]  issue_checkpoint_thread+0x6c/0xb8
      [    2.796112]  kthread+0x138/0x414
      [    2.796114]  ret_from_fork+0x10/0x18
      [    2.796117] Code: aa0803e0 aa1f03e1 52800022 aa0103e9 (c8e97d02)
      [    2.796120] ---[ end trace 96e942e8eb6a0b53 ]---
      [    2.800116] Kernel panic - not syncing: Fatal exception
      [    2.800120] SMP: stopping secondary CPUs
      
      Fixes: 9de71ede ("f2fs: quota: fix potential deadlock")
      Cc: <stable@vger.kernel.org> # v5.15+
      Signed-off-by: default avatarJuhyung Park <qkrwngud825@gmail.com>
      Reviewed-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      680af5b8
    • Bart Van Assche's avatar
      f2fs: Restore rwsem lockdep support · c7f91bd4
      Bart Van Assche authored
      Lockdep uses lock class keys in its analysis. init_rwsem() instantiates
      one lock class key with each init_rwsem() user as follows:
      
       #define init_rwsem(sem)                                        \
       do {                                                           \
               static struct lock_class_key __key;                    \
                                                                      \
               __init_rwsem((sem), #sem, &__key);                     \
       } while (0)
      
      Commit e4544b63 ("f2fs: move f2fs to use reader-unfair rwsems") reduced
      the number of lock class keys from one per init_rwsem() user to one per
      file in which init_f2fs_rwsem() is used. This causes the same lock class key
      to be associated with multiple f2fs rwsems and also triggers a number of
      false positive lockdep deadlock reports. Fix this by again instantiating one
      lock class key with each init_f2fs_rwsem() caller.
      
      Cc: Tim Murray <timmurray@google.com>
      Reported-by: syzbot+0b9cadf5fc45a98a5083@syzkaller.appspotmail.com
      Fixes: e4544b63 ("f2fs: move f2fs to use reader-unfair rwsems")
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      c7f91bd4
    • Jaegeuk Kim's avatar
      f2fs: fix missing free nid in f2fs_handle_failed_inode · 2fef99b8
      Jaegeuk Kim authored
      This patch fixes xfstests/generic/475 failure.
      
      [  293.680694] F2FS-fs (dm-1): May loss orphan inode, run fsck to fix.
      [  293.685358] Buffer I/O error on dev dm-1, logical block 8388592, async page read
      [  293.691527] Buffer I/O error on dev dm-1, logical block 8388592, async page read
      [  293.691764] sh (7615): drop_caches: 3
      [  293.691819] sh (7616): drop_caches: 3
      [  293.694017] Buffer I/O error on dev dm-1, logical block 1, async page read
      [  293.695659] sh (7618): drop_caches: 3
      [  293.696979] sh (7617): drop_caches: 3
      [  293.700290] sh (7623): drop_caches: 3
      [  293.708621] sh (7626): drop_caches: 3
      [  293.711386] sh (7628): drop_caches: 3
      [  293.711825] sh (7627): drop_caches: 3
      [  293.716738] sh (7630): drop_caches: 3
      [  293.719613] sh (7632): drop_caches: 3
      [  293.720971] sh (7633): drop_caches: 3
      [  293.727741] sh (7634): drop_caches: 3
      [  293.730783] sh (7636): drop_caches: 3
      [  293.732681] sh (7635): drop_caches: 3
      [  293.732988] sh (7637): drop_caches: 3
      [  293.738836] sh (7639): drop_caches: 3
      [  293.740568] sh (7641): drop_caches: 3
      [  293.743053] sh (7640): drop_caches: 3
      [  293.821889] ------------[ cut here ]------------
      [  293.824654] kernel BUG at fs/f2fs/node.c:3334!
      [  293.826226] invalid opcode: 0000 [#1] PREEMPT SMP PTI
      [  293.828713] CPU: 0 PID: 7653 Comm: umount Tainted: G           OE     5.17.0-rc1-custom #1
      [  293.830946] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
      [  293.832526] RIP: 0010:f2fs_destroy_node_manager+0x33f/0x350 [f2fs]
      [  293.833905] Code: e8 d6 3d f9 f9 48 8b 45 d0 65 48 2b 04 25 28 00 00 00 75 1a 48 81 c4 28 03 00 00 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b
      [  293.837783] RSP: 0018:ffffb04ec31e7a20 EFLAGS: 00010202
      [  293.839062] RAX: 0000000000000001 RBX: ffff9df947db2eb8 RCX: 0000000080aa0072
      [  293.840666] RDX: 0000000000000000 RSI: ffffe86c0432a140 RDI: ffffffffc0b72a21
      [  293.842261] RBP: ffffb04ec31e7d70 R08: ffff9df94ca85780 R09: 0000000080aa0072
      [  293.843909] R10: ffff9df94ca85700 R11: ffff9df94e1ccf58 R12: ffff9df947db2e00
      [  293.845594] R13: ffff9df947db2ed0 R14: ffff9df947db2eb8 R15: ffff9df947db2eb8
      [  293.847855] FS:  00007f5a97379800(0000) GS:ffff9dfa77c00000(0000) knlGS:0000000000000000
      [  293.850647] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  293.852940] CR2: 00007f5a97528730 CR3: 000000010bc76005 CR4: 0000000000370ef0
      [  293.854680] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  293.856423] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  293.858380] Call Trace:
      [  293.859302]  <TASK>
      [  293.860311]  ? ttwu_do_wakeup+0x1c/0x170
      [  293.861800]  ? ttwu_do_activate+0x6d/0xb0
      [  293.863057]  ? _raw_spin_unlock_irqrestore+0x29/0x40
      [  293.864411]  ? try_to_wake_up+0x9d/0x5e0
      [  293.865618]  ? debug_smp_processor_id+0x17/0x20
      [  293.866934]  ? debug_smp_processor_id+0x17/0x20
      [  293.868223]  ? free_unref_page+0xbf/0x120
      [  293.869470]  ? __free_slab+0xcb/0x1c0
      [  293.870614]  ? preempt_count_add+0x7a/0xc0
      [  293.871811]  ? __slab_free+0xa0/0x2d0
      [  293.872918]  ? __wake_up_common_lock+0x8a/0xc0
      [  293.874186]  ? __slab_free+0xa0/0x2d0
      [  293.875305]  ? free_inode_nonrcu+0x20/0x20
      [  293.876466]  ? free_inode_nonrcu+0x20/0x20
      [  293.877650]  ? debug_smp_processor_id+0x17/0x20
      [  293.878949]  ? call_rcu+0x11a/0x240
      [  293.880060]  ? f2fs_destroy_stats+0x59/0x60 [f2fs]
      [  293.881437]  ? kfree+0x1fe/0x230
      [  293.882674]  f2fs_put_super+0x160/0x390 [f2fs]
      [  293.883978]  generic_shutdown_super+0x7a/0x120
      [  293.885274]  kill_block_super+0x27/0x50
      [  293.886496]  kill_f2fs_super+0x7f/0x100 [f2fs]
      [  293.887806]  deactivate_locked_super+0x35/0xa0
      [  293.889271]  deactivate_super+0x40/0x50
      [  293.890513]  cleanup_mnt+0x139/0x190
      [  293.891689]  __cleanup_mnt+0x12/0x20
      [  293.892850]  task_work_run+0x64/0xa0
      [  293.894035]  exit_to_user_mode_prepare+0x1b7/0x1c0
      [  293.895409]  syscall_exit_to_user_mode+0x27/0x50
      [  293.896872]  do_syscall_64+0x48/0xc0
      [  293.898090]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  293.899517] RIP: 0033:0x7f5a975cd25b
      
      Fixes: 7735730d ("f2fs: fix to propagate error from __get_meta_page()")
      Reviewed-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      2fef99b8
  6. 12 Feb, 2022 2 commits
    • Chao Yu's avatar
      f2fs: support idmapped mounts · 984fc4e7
      Chao Yu authored
      This patch enables idmapped mounts for f2fs, since all dedicated helpers
      for this functionality existsm, so, in this patch we just pass down the
      user_namespace argument from the VFS methods to the relevant helpers.
      
      Simple idmap example on f2fs image:
      
      1. truncate -s 128M f2fs.img
      2. mkfs.f2fs f2fs.img
      3. mount f2fs.img /mnt/f2fs/
      4. touch /mnt/f2fs/file
      
      5. ls -ln /mnt/f2fs/
      total 0
      -rw-r--r-- 1 0 0 0 2月   4 13:17 file
      
      6. ./mount-idmapped --map-mount b:0:1001:1 /mnt/f2fs/ /mnt/scratch_f2fs/
      
      7. ls -ln /mnt/scratch_f2fs/
      total 0
      -rw-r--r-- 1 1001 1001 0 2月   4 13:17 file
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      984fc4e7
    • Jaegeuk Kim's avatar
      f2fs: add a way to limit roll forward recovery time · 47c8ebcc
      Jaegeuk Kim authored
      This adds a sysfs entry to call checkpoint during fsync() in order to avoid
      long elapsed time to run roll-forward recovery when booting the device.
      Default value doesn't enforce the limitation which is same as before.
      Reviewed-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      47c8ebcc
  7. 07 Feb, 2022 1 commit
    • Chao Yu's avatar
      f2fs: introduce F2FS_IPU_HONOR_OPU_WRITE ipu policy · 1018a546
      Chao Yu authored
      Once F2FS_IPU_FORCE policy is enabled in some cases:
      a) f2fs forces to use F2FS_IPU_FORCE in a small-sized volume
      b) user sets F2FS_IPU_FORCE policy via sysfs
      
      Then we may fail to defragment file due to IPU policy check, it doesn't
      make sense, let's introduce a new IPU policy to allow OPU during file
      defragmentation.
      
      In small-sized volume, let's enable F2FS_IPU_HONOR_OPU_WRITE policy
      by default.
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      1018a546
  8. 04 Feb, 2022 2 commits
  9. 03 Feb, 2022 2 commits
  10. 25 Jan, 2022 2 commits
  11. 23 Jan, 2022 10 commits
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · dd81e1c7
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - A series of bpf fixes, including an oops fix and some codegen fixes.
      
       - Fix a regression in syscall_get_arch() for compat processes.
      
       - Fix boot failure on some 32-bit systems with KASAN enabled.
      
       - A couple of other build/minor fixes.
      
      Thanks to Athira Rajeev, Christophe Leroy, Dmitry V. Levin, Jiri Olsa,
      Johan Almbladh, Maxime Bizon, Naveen N. Rao, and Nicholas Piggin.
      
      * tag 'powerpc-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/64s: Mask SRR0 before checking against the masked NIP
        powerpc/perf: Only define power_pmu_wants_prompt_pmi() for CONFIG_PPC64
        powerpc/32s: Fix kasan_init_region() for KASAN
        powerpc/time: Fix build failure due to do_hard_irq_enable() on PPC32
        powerpc/audit: Fix syscall_get_arch()
        powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06
        tools/bpf: Rename 'struct event' to avoid naming conflict
        powerpc/bpf: Update ldimm64 instructions during extra pass
        powerpc32/bpf: Fix codegen for bpf-to-bpf calls
        bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack()
      dd81e1c7
    • Linus Torvalds's avatar
      Merge tag 'irq_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ac5a9bb6
      Linus Torvalds authored
      Pull irq fix from Borislav Petkov:
       "A single use-after-free fix in the PCI MSI irq domain allocation path"
      
      * tag 'irq_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        PCI/MSI: Prevent UAF in error path
      ac5a9bb6
    • Linus Torvalds's avatar
      Merge tag 'sched_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 10c64a0f
      Linus Torvalds authored
      Pull scheduler fixes from Borislav Petkov:
       "A bunch of fixes: forced idle time accounting, utilization values
        propagation in the sched hierarchies and other minor cleanups and
        improvements"
      
      * tag 'sched_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        kernel/sched: Remove dl_boosted flag comment
        sched: Avoid double preemption in __cond_resched_*lock*()
        sched/fair: Fix all kernel-doc warnings
        sched/core: Accounting forceidle time for all tasks except idle task
        sched/pelt: Relax the sync of load_sum with load_avg
        sched/pelt: Relax the sync of runnable_sum with runnable_avg
        sched/pelt: Continue to relax the sync of util_sum with util_avg
        sched/pelt: Relax the sync of util_sum with util_avg
        psi: Fix uaf issue when psi trigger is destroyed while being polled
      10c64a0f
    • Linus Torvalds's avatar
      Merge tag 'perf_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0f9e0422
      Linus Torvalds authored
      Pull perf fixes from Borislav Petkov:
      
       - Add support for accessing the general purpose counters on Alder Lake
         via MMIO
      
       - Add new LBR format v7 support which is v5 modulo TSX
      
       - Fix counter enumeration on Alder Lake hybrids
      
       - Overhaul how context time updates are done and get rid of
         perf_event::shadow_ctx_time.
      
       - The usual amount of fixes: event mask correction, supported event
         types reporting, etc.
      
      * tag 'perf_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/perf: Avoid warning for Arch LBR without XSAVE
        perf/x86/intel/uncore: Add IMC uncore support for ADL
        perf/x86/intel/lbr: Add static_branch for LBR INFO flags
        perf/x86/intel/lbr: Support LBR format V7
        perf/x86/rapl: fix AMD event handling
        perf/x86/intel/uncore: Fix CAS_COUNT_WRITE issue for ICX
        perf/x86/intel: Add a quirk for the calculation of the number of counters on Alder Lake
        perf: Fix perf_event_read_local() time
      0f9e0422
    • Linus Torvalds's avatar
      Linux 5.17-rc1 · e783362e
      Linus Torvalds authored
      e783362e
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-for-v5.17-2022-01-22' of... · 40c84321
      Linus Torvalds authored
      Merge tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull more perf tools updates from Arnaldo Carvalho de Melo:
      
       - Fix printing 'phys_addr' in 'perf script'.
      
       - Fix failure to add events with 'perf probe' in ppc64 due to not
         removing leading dot (ppc64 ABIv1).
      
       - Fix cpu_map__item() python binding building.
      
       - Support event alias in form foo-bar-baz, add pmu-events and
         parse-event tests for it.
      
       - No need to setup affinities when starting a workload or attaching to
         a pid.
      
       - Use path__join() to compose a path instead of ad-hoc snprintf()
         equivalent.
      
       - Override attr->sample_period for non-libpfm4 events.
      
       - Use libperf cpumap APIs instead of accessing the internal state
         directly.
      
       - Sync x86 arch prctl headers and files changed by the new
         set_mempolicy_home_node syscall with the kernel sources.
      
       - Remove duplicate include in cpumap.h.
      
       - Remove redundant err variable.
      
      * tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf tools: Remove redundant err variable
        perf test: Add parse-events test for aliases with hyphens
        perf test: Add pmu-events test for aliases with hyphens
        perf parse-events: Support event alias in form foo-bar-baz
        perf evsel: Override attr->sample_period for non-libpfm4 events
        perf cpumap: Remove duplicate include in cpumap.h
        perf cpumap: Migrate to libperf cpumap api
        perf python: Fix cpu_map__item() building
        perf script: Fix printing 'phys_addr' failure issue
        tools headers UAPI: Sync files changed by new set_mempolicy_home_node syscall
        tools headers UAPI: Sync x86 arch prctl headers with the kernel sources
        perf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename)
        perf evlist: No need to setup affinities when disabling events for pid targets
        perf evlist: No need to setup affinities when enabling events for pid targets
        perf stat: No need to setup affinities when starting a workload
        perf affinity: Allow passing a NULL arg to affinity__cleanup()
        perf probe: Fix ppc64 'perf probe add events failed' case
      40c84321
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 67bfce0e
      Linus Torvalds authored
      Pull ftrace fix from Steven Rostedt:
       "Fix s390 breakage from sorting mcount tables.
      
        The latest merge of the tracing tree sorts the mcount table at build
        time. But s390 appears to do things differently (like always) and
        replaces the sorted table back to the original unsorted one. As the
        ftrace algorithm depends on it being sorted, bad things happen when it
        is not, and s390 experienced those bad things.
      
        Add a new config to tell the boot if the mcount table is sorted or
        not, and allow s390 to opt out of it"
      
      * tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace: Fix assuming build time sort works for s390
      67bfce0e
    • Steven Rostedt (Google)'s avatar
      ftrace: Fix assuming build time sort works for s390 · 6b9b6413
      Steven Rostedt (Google) authored
      To speed up the boot process, as mcount_loc needs to be sorted for ftrace
      to work properly, sorting it at build time is more efficient than boot up
      and can save milliseconds of time. Unfortunately, this change broke s390
      as it will modify the mcount_loc location after the sorting takes place
      and will put back the unsorted locations. Since the sorting is skipped at
      boot up if it is believed that it was sorted at run time, ftrace can crash
      as its algorithms are dependent on the list being sorted.
      
      Add a new config BUILDTIME_MCOUNT_SORT that is set when
      BUILDTIME_TABLE_SORT but not if S390 is set. Use this config to determine
      if sorting should take place at boot up.
      
      Link: https://lore.kernel.org/all/yt9dee51ctfn.fsf@linux.ibm.com/
      
      Fixes: 72b3942a ("scripts: ftrace - move the sort-processing in ftrace_init")
      Reported-by: default avatarSven Schnelle <svens@linux.ibm.com>
      Tested-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      6b9b6413
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v5.17' of... · 473aec0e
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Bring include/uapi/linux/nfc.h into the UAPI compile-test coverage
      
       - Revert the workaround of CONFIG_CC_IMPLICIT_FALLTHROUGH
      
       - Fix build errors in certs/Makefile
      
      * tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty
        certs: Fix build error when CONFIG_MODULE_SIG_KEY is PKCS#11 URI
        Revert "Makefile: Do not quote value for CONFIG_CC_IMPLICIT_FALLTHROUGH"
        usr/include/Makefile: add linux/nfc.h to the compile-test coverage
      473aec0e
    • Linus Torvalds's avatar
      Merge tag 'bitmap-5.17-rc1' of git://github.com/norov/linux · 3689f9f8
      Linus Torvalds authored
      Pull bitmap updates from Yury Norov:
      
       - introduce for_each_set_bitrange()
      
       - use find_first_*_bit() instead of find_next_*_bit() where possible
      
       - unify for_each_bit() macros
      
      * tag 'bitmap-5.17-rc1' of git://github.com/norov/linux:
        vsprintf: rework bitmap_list_string
        lib: bitmap: add performance test for bitmap_print_to_pagebuf
        bitmap: unify find_bit operations
        mm/percpu: micro-optimize pcpu_is_populated()
        Replace for_each_*_bit_from() with for_each_*_bit() where appropriate
        find: micro-optimize for_each_{set,clear}_bit()
        include/linux: move for_each_bit() macros from bitops.h to find.h
        cpumask: replace cpumask_next_* with cpumask_first_* where appropriate
        tools: sync tools/bitmap with mother linux
        all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate
        cpumask: use find_first_and_bit()
        lib: add find_first_and_bit()
        arch: remove GENERIC_FIND_FIRST_BIT entirely
        include: move find.h from asm_generic to linux
        bitops: move find_bit_*_le functions from le.h to find.h
        bitops: protect find_first_{,zero}_bit properly
      3689f9f8
  12. 22 Jan, 2022 12 commits