Re: [f2fs-dev] [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-03-22 Thread Hillf Danton
On Thu, 21 Mar 2024 17:29:03 -0700 Jaegeuk Kim 
> 
> I posted this patch before Light reported.

Yeah, his report's timestamp is 2024-03-20  6:59, nearly 7 hours later,
which shows that you constructed the deadlock with nothing to do with
his report.
> 
> And, in the report, I didn't get this:
> 
> f2fs_ioc_shutdown() --> freeze_bdev() --> freeze_super() --> 
> sb_wait_write(sb, SB_FREEZE_FS) --> ... ->percpu_down_write().
> 
> because f2fs_ioc_shutdown() calls f2fs_stop_discard_thread() after thaw_bdev()
> like this order.
> 
>  -> freeze_bdev()
>  -> thaw_bdev()
>  -> f2fs_stop_discard_thread()
> 
> Am I missing something?

Light, could you specify to help Jaegeuk understand the deadlock you reported?



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-03-21 Thread Hillf Danton
On Tue, 19 Mar 2024 17:14:42 -0700 Jaegeuk Kim 
> f2fs_ioc_shutdown(F2FS_GOING_DOWN_NOSYNC)  issue_discard_thread
>  - mnt_want_write_file()
>- sb_start_write(SB_FREEZE_WRITE)
 __sb_start_write()
   percpu_down_read()
>  - 
> sb_start_intwrite(SB_FREEZE_FS);
   __sb_start_write()
 percpu_down_read()

Given lock acquirers for read on both sides, wtf deadlock are you fixing?

>  - f2fs_stop_checkpoint(sbi, false,: waiting
> STOP_CP_REASON_SHUTDOWN);
>  - f2fs_stop_discard_thread(sbi);
>- kthread_stop()
>  : waiting
> 
>  - mnt_drop_write_file(filp);

More important, feel free to add in spin.

Reported-by: "Light Hsieh (謝明燈)" 


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: move f2fs to use reader-unfair rwsems

2022-02-27 Thread Hillf Danton
On Fri, 25 Feb 2022 16:32:39 +0800 Hillf Danton wrote:
> On Fri, 25 Feb 2022 09:47:16 +0800 Hillf Danton wrote:
> > On Thu, 24 Feb 2022 16:47:30 +0800 Hillf Danton wrote:
> > > On Sat,  8 Jan 2022 08:46:17 -0800
> > > > From: Tim Murray 
> > > > 
> > > > f2fs rw_semaphores work better if writers can starve readers,
> > > > especially for the checkpoint thread, because writers are strictly
> > > > more important than reader threads. This prevents significant priority
> > > > inversion between low-priority readers that blocked while trying to
> > > > acquire the read lock and a second acquisition of the write lock that
> > > > might be blocking high priority work.
> > > > 
> > > > Signed-off-by: Tim Murray 
> > > > Signed-off-by: Jaegeuk Kim 
> > > > ---
> > > 
> > > ...
> > > 
> > > > +/*
> > > > + * An implementation of an rwsem that is explicitly unfair to readers. 
> > > > This
> > > > + * prevents priority inversion when a low-priority reader acquires the 
> > > > read lock
> > > > + * while sleeping on the write lock but the write lock is needed by
> > > > + * higher-priority clients.
> > > > + */
> > > > +
> > > > +struct f2fs_rwsem {
> > > > +struct rw_semaphore internal_rwsem;
> > > > +wait_queue_head_t read_waiters;
> > > > +};
> > > 
> > > ...
> > > 
> > > > +static inline void f2fs_down_read(struct f2fs_rwsem *sem)
> > > > +{
> > > > +   wait_event(sem->read_waiters, 
> > > > down_read_trylock(>internal_rwsem));
> > > > +}
> > > > +
> > > > +static inline int f2fs_down_read_trylock(struct f2fs_rwsem *sem)
> > > > +{
> > > > +   return down_read_trylock(>internal_rwsem);
> > > > +}
> > > > +
> > > > +static inline void f2fs_up_read(struct f2fs_rwsem *sem)
> > > > +{
> > > > +   up_read(>internal_rwsem);
> > > > +}
> > > > +
> > > > +static inline void f2fs_down_write(struct f2fs_rwsem *sem)
> > > > +{
> > > > +   down_write(>internal_rwsem);
> > > > +}
> > > > +
> > > > +static inline int f2fs_down_write_trylock(struct f2fs_rwsem *sem)
> > > > +{
> > > > +   return down_write_trylock(>internal_rwsem);
> > > > +}
> > > > +
> > > > +static inline void f2fs_up_write(struct f2fs_rwsem *sem)
> > > > +{
> > > > +   up_write(>internal_rwsem);
> > > > +   wake_up_all(>read_waiters);
> > > > +}
> > > > +
> > > 
> > > Here is my two cents, the unfair rwsem derived from lock_sock(), which has
> > > no link to rwsem.
> > > 
> > > Only for thoughts now.
> > > 
> > > Hillf
> > > 
> > > struct unfair_rwsem {
> > >   spinlock_t  lock;
> > >   int owner; /* < 0 writer, > 0 readers */
> > > 
> > >   struct list_head reader, writer; /* read/write waiters */
> > > 
> > > #ifdef CONFIG_DEBUG_LOCK_ALLOC
> > >   struct lockdep_map dep_map;
> > > #endif
> > > };
> > > 
> > > struct unfair_rwsem_wait {
> > >   struct list_headnode;
> > >   struct task_struct  *task;
> > > };
> > > 
> > > static void lock_unfair_rwsem(struct unfair_rwsem *us, int read)
> > > {
> > >   struct unfair_rwsem_wait wait;
> > > 
> > >   mutex_acquire(>dep_map, 0, 0, _RET_IP_);
> > >   might_sleep();
> > >   wait.task = current;
> > >   for (;;) {
> > >   spin_lock(>lock);
> > >   if (read) {
> > >   if (us->owner >= 0) {
> > >   us->owner++;
> > >   spin_unlock(>lock);
> > >   return;
> > >   }
> > >   list_add_tail(, >reader);
> > >   } else {
> > >   if (us->owner == 0) {
> > >   us->owner--;
> > >   spin_unlock(>lock);
> > >   return;
> > >   }
> > >   list_add_tail(, >writer);
&

Re: [f2fs-dev] [PATCH] f2fs: move f2fs to use reader-unfair rwsems

2022-02-25 Thread Hillf Danton
On Fri, 25 Feb 2022 09:47:16 +0800 Hillf Danton wrote:
> On Thu, 24 Feb 2022 16:47:30 +0800 Hillf Danton wrote:
> > On Sat,  8 Jan 2022 08:46:17 -0800
> > > From: Tim Murray 
> > > 
> > > f2fs rw_semaphores work better if writers can starve readers,
> > > especially for the checkpoint thread, because writers are strictly
> > > more important than reader threads. This prevents significant priority
> > > inversion between low-priority readers that blocked while trying to
> > > acquire the read lock and a second acquisition of the write lock that
> > > might be blocking high priority work.
> > > 
> > > Signed-off-by: Tim Murray 
> > > Signed-off-by: Jaegeuk Kim 
> > > ---
> > 
> > ...
> > 
> > > +/*
> > > + * An implementation of an rwsem that is explicitly unfair to readers. 
> > > This
> > > + * prevents priority inversion when a low-priority reader acquires the 
> > > read lock
> > > + * while sleeping on the write lock but the write lock is needed by
> > > + * higher-priority clients.
> > > + */
> > > +
> > > +struct f2fs_rwsem {
> > > +struct rw_semaphore internal_rwsem;
> > > +wait_queue_head_t read_waiters;
> > > +};
> > 
> > ...
> > 
> > > +static inline void f2fs_down_read(struct f2fs_rwsem *sem)
> > > +{
> > > + wait_event(sem->read_waiters, down_read_trylock(>internal_rwsem));
> > > +}
> > > +
> > > +static inline int f2fs_down_read_trylock(struct f2fs_rwsem *sem)
> > > +{
> > > + return down_read_trylock(>internal_rwsem);
> > > +}
> > > +
> > > +static inline void f2fs_up_read(struct f2fs_rwsem *sem)
> > > +{
> > > + up_read(>internal_rwsem);
> > > +}
> > > +
> > > +static inline void f2fs_down_write(struct f2fs_rwsem *sem)
> > > +{
> > > + down_write(>internal_rwsem);
> > > +}
> > > +
> > > +static inline int f2fs_down_write_trylock(struct f2fs_rwsem *sem)
> > > +{
> > > + return down_write_trylock(>internal_rwsem);
> > > +}
> > > +
> > > +static inline void f2fs_up_write(struct f2fs_rwsem *sem)
> > > +{
> > > + up_write(>internal_rwsem);
> > > + wake_up_all(>read_waiters);
> > > +}
> > > +
> > 
> > Here is my two cents, the unfair rwsem derived from lock_sock(), which has
> > no link to rwsem.
> > 
> > Only for thoughts now.
> > 
> > Hillf
> > 
> > struct unfair_rwsem {
> > spinlock_t  lock;
> > int owner; /* < 0 writer, > 0 readers */
> > 
> > struct list_head reader, writer; /* read/write waiters */
> > 
> > #ifdef CONFIG_DEBUG_LOCK_ALLOC
> > struct lockdep_map dep_map;
> > #endif
> > };
> > 
> > struct unfair_rwsem_wait {
> > struct list_headnode;
> > struct task_struct  *task;
> > };
> > 
> > static void lock_unfair_rwsem(struct unfair_rwsem *us, int read)
> > {
> > struct unfair_rwsem_wait wait;
> > 
> > mutex_acquire(>dep_map, 0, 0, _RET_IP_);
> > might_sleep();
> > wait.task = current;
> > for (;;) {
> > spin_lock(>lock);
> > if (read) {
> > if (us->owner >= 0) {
> > us->owner++;
> > spin_unlock(>lock);
> > return;
> > }
> > list_add_tail(, >reader);
> > } else {
> > if (us->owner == 0) {
> > us->owner--;
> > spin_unlock(>lock);
> > return;
> > }
> > list_add_tail(, >writer);
> > }
> > set_current_state(TASK_UNINTERRUPTIBLE);
> > spin_unlock(>lock);
> > schedule();
> > }
> > }
> > 
> > void down_read_unfair_rwsem(struct unfair_rwsem *us)
> > {
> > lock_unfair_rwsem(us, 1);
> > }
> > 
> > void down_write_unfair_rwsem(struct unfair_rwsem *us)
> > {
> > lock_unfair_rwsem(us, 0);
> > }
> > 
> > static void unlock_unfair_rwsem(struct unfair_rwsem *us, int read)
> > {
> > struct list_head *head = NULL;
> > int all 

Re: [f2fs-dev] [PATCH] f2fs: move f2fs to use reader-unfair rwsems

2022-02-24 Thread Hillf Danton
On Thu, 24 Feb 2022 16:47:30 +0800 Hillf Danton wrote:
> On Sat,  8 Jan 2022 08:46:17 -0800
> > From: Tim Murray 
> > 
> > f2fs rw_semaphores work better if writers can starve readers,
> > especially for the checkpoint thread, because writers are strictly
> > more important than reader threads. This prevents significant priority
> > inversion between low-priority readers that blocked while trying to
> > acquire the read lock and a second acquisition of the write lock that
> > might be blocking high priority work.
> > 
> > Signed-off-by: Tim Murray 
> > Signed-off-by: Jaegeuk Kim 
> > ---
> 
> ...
> 
> > +/*
> > + * An implementation of an rwsem that is explicitly unfair to readers. This
> > + * prevents priority inversion when a low-priority reader acquires the 
> > read lock
> > + * while sleeping on the write lock but the write lock is needed by
> > + * higher-priority clients.
> > + */
> > +
> > +struct f2fs_rwsem {
> > +struct rw_semaphore internal_rwsem;
> > +wait_queue_head_t read_waiters;
> > +};
> 
> ...
> 
> > +static inline void f2fs_down_read(struct f2fs_rwsem *sem)
> > +{
> > +   wait_event(sem->read_waiters, down_read_trylock(>internal_rwsem));
> > +}
> > +
> > +static inline int f2fs_down_read_trylock(struct f2fs_rwsem *sem)
> > +{
> > +   return down_read_trylock(>internal_rwsem);
> > +}
> > +
> > +static inline void f2fs_up_read(struct f2fs_rwsem *sem)
> > +{
> > +   up_read(>internal_rwsem);
> > +}
> > +
> > +static inline void f2fs_down_write(struct f2fs_rwsem *sem)
> > +{
> > +   down_write(>internal_rwsem);
> > +}
> > +
> > +static inline int f2fs_down_write_trylock(struct f2fs_rwsem *sem)
> > +{
> > +   return down_write_trylock(>internal_rwsem);
> > +}
> > +
> > +static inline void f2fs_up_write(struct f2fs_rwsem *sem)
> > +{
> > +   up_write(>internal_rwsem);
> > +   wake_up_all(>read_waiters);
> > +}
> > +
> 
> Here is my two cents, the unfair rwsem derived from lock_sock(), which has
> no link to rwsem.
> 
> Only for thoughts now.
> 
> Hillf
> 
> struct unfair_rwsem {
>   spinlock_t  lock;
>   int owner; /* < 0 writer, > 0 readers */
> 
>   struct list_head reader, writer; /* read/write waiters */
> 
> #ifdef CONFIG_DEBUG_LOCK_ALLOC
>   struct lockdep_map dep_map;
> #endif
> };
> 
> struct unfair_rwsem_wait {
>   struct list_headnode;
>   struct task_struct  *task;
> };
> 
> static void lock_unfair_rwsem(struct unfair_rwsem *us, int read)
> {
>   struct unfair_rwsem_wait wait;
> 
>   mutex_acquire(>dep_map, 0, 0, _RET_IP_);
>   might_sleep();
>   wait.task = current;
>   for (;;) {
>   spin_lock(>lock);
>   if (read) {
>   if (us->owner >= 0) {
>   us->owner++;
>   spin_unlock(>lock);
>   return;
>   }
>   list_add_tail(, >reader);
>   } else {
>   if (us->owner == 0) {
>   us->owner--;
>   spin_unlock(>lock);
>   return;
>   }
>   list_add_tail(, >writer);
>   }
>   set_current_state(TASK_UNINTERRUPTIBLE);
>   spin_unlock(>lock);
>   schedule();
>   }
> }
> 
> void down_read_unfair_rwsem(struct unfair_rwsem *us)
> {
>   lock_unfair_rwsem(us, 1);
> }
> 
> void down_write_unfair_rwsem(struct unfair_rwsem *us)
> {
>   lock_unfair_rwsem(us, 0);
> }
> 
> static void unlock_unfair_rwsem(struct unfair_rwsem *us, int read)
> {
>   struct list_head *head = NULL;
>   int all = 0;
> 
>   spin_lock(>lock);
>   if (us->owner < 0) {
>   BUG_ON(read);
>   us->owner++;
>   BUG_ON(0 != us->owner);
> 
>   if (!list_empty(>writer))
>   head = >writer;
>   else if (!list_empty(>reader)) {
>   head = >reader;
>   all = 1;
>   }
>   } else if (us->owner > 0) {
>   BUG_ON(!read);
>   BUG_ON(!list_empty(>reader));
>   us->owner--;
>

[f2fs-dev] [PATCH] f2fs: move f2fs to use reader-unfair rwsems

2022-02-24 Thread Hillf Danton
On Sat,  8 Jan 2022 08:46:17 -0800
> From: Tim Murray 
> 
> f2fs rw_semaphores work better if writers can starve readers,
> especially for the checkpoint thread, because writers are strictly
> more important than reader threads. This prevents significant priority
> inversion between low-priority readers that blocked while trying to
> acquire the read lock and a second acquisition of the write lock that
> might be blocking high priority work.
> 
> Signed-off-by: Tim Murray 
> Signed-off-by: Jaegeuk Kim 
> ---

...

> +/*
> + * An implementation of an rwsem that is explicitly unfair to readers. This
> + * prevents priority inversion when a low-priority reader acquires the read 
> lock
> + * while sleeping on the write lock but the write lock is needed by
> + * higher-priority clients.
> + */
> +
> +struct f2fs_rwsem {
> +struct rw_semaphore internal_rwsem;
> +wait_queue_head_t read_waiters;
> +};

...

> +static inline void f2fs_down_read(struct f2fs_rwsem *sem)
> +{
> + wait_event(sem->read_waiters, down_read_trylock(>internal_rwsem));
> +}
> +
> +static inline int f2fs_down_read_trylock(struct f2fs_rwsem *sem)
> +{
> + return down_read_trylock(>internal_rwsem);
> +}
> +
> +static inline void f2fs_up_read(struct f2fs_rwsem *sem)
> +{
> + up_read(>internal_rwsem);
> +}
> +
> +static inline void f2fs_down_write(struct f2fs_rwsem *sem)
> +{
> + down_write(>internal_rwsem);
> +}
> +
> +static inline int f2fs_down_write_trylock(struct f2fs_rwsem *sem)
> +{
> + return down_write_trylock(>internal_rwsem);
> +}
> +
> +static inline void f2fs_up_write(struct f2fs_rwsem *sem)
> +{
> + up_write(>internal_rwsem);
> + wake_up_all(>read_waiters);
> +}
> +

Here is my two cents, the unfair rwsem derived from lock_sock(), which has
no link to rwsem.

Only for thoughts now.

Hillf

struct unfair_rwsem {
spinlock_t  lock;
int owner; /* < 0 writer, > 0 readers */

struct list_head reader, writer; /* read/write waiters */

#ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lockdep_map dep_map;
#endif
};

struct unfair_rwsem_wait {
struct list_headnode;
struct task_struct  *task;
};

static void lock_unfair_rwsem(struct unfair_rwsem *us, int read)
{
struct unfair_rwsem_wait wait;

mutex_acquire(>dep_map, 0, 0, _RET_IP_);
might_sleep();
wait.task = current;
for (;;) {
spin_lock(>lock);
if (read) {
if (us->owner >= 0) {
us->owner++;
spin_unlock(>lock);
return;
}
list_add_tail(, >reader);
} else {
if (us->owner == 0) {
us->owner--;
spin_unlock(>lock);
return;
}
list_add_tail(, >writer);
}
set_current_state(TASK_UNINTERRUPTIBLE);
spin_unlock(>lock);
schedule();
}
}

void down_read_unfair_rwsem(struct unfair_rwsem *us)
{
lock_unfair_rwsem(us, 1);
}

void down_write_unfair_rwsem(struct unfair_rwsem *us)
{
lock_unfair_rwsem(us, 0);
}

static void unlock_unfair_rwsem(struct unfair_rwsem *us, int read)
{
struct list_head *head = NULL;
int all = 0;

spin_lock(>lock);
if (us->owner < 0) {
BUG_ON(read);
us->owner++;
BUG_ON(0 != us->owner);

if (!list_empty(>writer))
head = >writer;
else if (!list_empty(>reader)) {
head = >reader;
all = 1;
}
} else if (us->owner > 0) {
BUG_ON(!read);
BUG_ON(!list_empty(>reader));
us->owner--;
if (us->owner == 0)
if (!list_empty(>writer))
head = >writer;
} else
BUG_ON(1);

mutex_release(>dep_map, _RET_IP_);
if (head) {
struct unfair_rwsem_wait *wait;
do {
wait = list_first_entry(head, struct unfair_rwsem_wait, 
node);
list_del(>node);
wake_up_process(wait->task);
} while (all && !list_empty(head));
}
spin_unlock(>lock);
}

void up_write_unfair_rwsem(struct unfair_rwsem *us)
{
unlock_unfair_rwsem(us, 0);
}

void up_read_unfair_rwsem(struct unfair_rwsem *us)
{
unlock_unfair_rwsem(us, 1);
}



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [syzbot] BUG: unable to handle kernel NULL pointer dereference in f2fs_update_meta_page

2021-07-26 Thread Hillf Danton
On Sun, 25 Jul 2021 23:00:19 -0700
> syzbot found the following issue on:
> 
> HEAD commit:6498f6151825 Merge tag 'riscv-for-linus-5.14-rc3' of git:/..
> git tree:   upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=14bbce4630
> kernel config:  https://syzkaller.appspot.com/x/.config?x=5dc0e3202ae2f574
> dashboard link: https://syzkaller.appspot.com/bug?extid=07ff38c9c93ca170de07
> compiler:   Debian clang version 11.0.1-2, GNU ld (GNU Binutils for 
> Debian) 2.35.1
> 
> Unfortunately, I don't have any reproducer for this issue yet.

Given the code [1], curious about the reasons possible behind this report.

2416 void f2fs_update_meta_page(struct f2fs_sb_info *sbi,
2417void *src, block_t blk_addr)
2418 {
2419struct page *page = f2fs_grab_meta_page(sbi, blk_addr);
2420
2421memcpy(page_address(page), src, PAGE_SIZE);
2422set_page_dirty(page);
2423f2fs_put_page(page, 1);
2424 }

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/f2fs/segment.c?id=6498f6151825#n2422

> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+07ff38c9c93ca170d...@syzkaller.appspotmail.com
> 
> BUG: kernel NULL pointer dereference, address: 
> #PF: supervisor instruction fetch in kernel mode
> #PF: error_code(0x0010) - not-present page
> PGD 7395a067 P4D 7395a067 PUD 7395b067 PMD 0 
> Oops: 0010 [#1] PREEMPT SMP KASAN
> CPU: 0 PID: 14793 Comm: syz-executor.3 Not tainted 5.14.0-rc2-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS 
> Google 01/01/2011
> RIP: 0010:0x0
> Code: Unable to access opcode bytes at RIP 0xffd6.
> RSP: 0018:c9000158f858 EFLAGS: 00010286
> RAX: 1147d97b RBX: 05ff RCX: 8a3ecbd8
> RDX:  RSI:  RDI: ea00027e9540
> RBP: c9000158fad0 R08: 81aa846c R09: f940004fd2a9
> R10: f940004fd2a9 R11:  R12: 888081491310
> R13: 0001 R14: 88807fa0e000 R15: ea00027e9540
> FS:  02a84400() GS:8880b9c0() knlGS:
> CS:  0010 DS:  ES:  CR0: 80050033
> CR2: ffd6 CR3: 73959000 CR4: 001526f0
> DR0:  DR1:  DR2: 
> DR3:  DR6: fffe0ff0 DR7: 0400
> Call Trace:
>  f2fs_update_meta_page+0x4b/0x380 fs/f2fs/segment.c:2422
>  do_checkpoint fs/f2fs/checkpoint.c:1492 [inline]
>  f2fs_write_checkpoint+0x2f1b/0x5060 fs/f2fs/checkpoint.c:1650
>  f2fs_issue_checkpoint+0x308/0x4a0 fs/f2fs/checkpoint.c:1718
>  __sync_filesystem fs/sync.c:39 [inline]
>  sync_filesystem+0x19e/0x200 fs/sync.c:67
>  generic_shutdown_super+0x6e/0x2b0 fs/super.c:448
>  kill_block_super+0x79/0xd0 fs/super.c:1395
>  kill_f2fs_super+0x2f9/0x3c0 fs/f2fs/super.c:4329
>  deactivate_locked_super+0xa7/0xf0 fs/super.c:335
>  cleanup_mnt+0x462/0x510 fs/namespace.c:1136
>  task_work_run+0x146/0x1c0 kernel/task_work.c:164
>  tracehook_notify_resume include/linux/tracehook.h:189 [inline]
>  exit_to_user_mode_loop kernel/entry/common.c:175 [inline]
>  exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209
>  __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
>  syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302
>  do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86
>  entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x467a47
> Code: ff d0 48 89 c7 b8 3c 00 00 00 0f 05 48 c7 c1 bc ff ff ff f7 d8 64 89 01 
> 48 83 c8 ff c3 66 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 
> 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
> RSP: 002b:7fffa4976ab8 EFLAGS: 0246 ORIG_RAX: 00a6
> RAX:  RBX:  RCX: 00467a47
> RDX: 7fffa4976b8b RSI: 0002 RDI: 7fffa4976b80
> RBP: 7fffa4976b80 R08:  R09: 7fffa4976950
> R10: 02a858e3 R11: 0246 R12: 004bee90
> R13: 7fffa4977c50 R14: 02a85810 R15: 7fffa4977c90
> Modules linked in:
> CR2: 
> ---[ end trace dff6785899946653 ]---
> RIP: 0010:0x0
> Code: Unable to access opcode bytes at RIP 0xffd6.
> RSP: 0018:c9000158f858 EFLAGS: 00010286
> RAX: 1147d97b RBX: 05ff RCX: 8a3ecbd8
> RDX:  RSI:  RDI: ea00027e9540
> RBP: c9000158fad0 R08: 81aa846c R09: f940004fd2a9
> R10: f940004fd2a9 R11:  R12: 888081491310
> R13: 0001 R14: 88807fa0e000 R15: ea00027e9540
> FS:  02a84400() GS:8880b9c0() knlGS:
> CS:  0010 DS:  ES:  CR0: 80050033
> CR2: ffd6 CR3: 73959000 CR4: 001526f0
> DR0:  DR1:  DR2: 
> 

Re: [f2fs-dev] [PATCH] f2fs: use rwlock instead of rwsem for journal

2021-07-21 Thread Hillf Danton
On Wed, 21 Jul 2021 18:41:49 -0700 Jaegeuk Kim wrote:
>
>This tries to fix priority inversion in the below condition resulting in
>long checkpoint delay.

If you are right and the patch makes real sense, feel free to specify a bit
more on the priority inversion you are trying to fix, and how the fix helps
shorten the checkpoint delay. And test data is welcome.

>
>f2fs_get_node_info()
> - nat_tree_lock
>  -> sleep in journal_rwsem
> checkpoint
> - waiting for nat_tree_lock


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel