Re: possible deadlock in shmem_fallocate (4)

2020-07-14 Thread Michal Hocko
On Tue 14-07-20 10:32:20, Suren Baghdasaryan wrote: [...] > I'm not sure how we can annotate the fact that the inode_lock in > generic_file_write_iter and in shmem_fallocate always operate on > different inodes. Ideas? I believe that the standard way is to use lockdep_set_class on your backing ino

Re: possible deadlock in shmem_fallocate (4)

2020-07-14 Thread Hillf Danton
On Tue, 14 Jul 2020 10:32:20 -0700 Suren Baghdasaryan wrote: > On Tue, Jul 14, 2020 at 9:41 AM Suren Baghdasaryan wrote: > > > > On Tue, Jul 14, 2020 at 8:47 AM Todd Kjos wrote: > > > > > > +Suren Baghdasaryan +Hridya Valsaraju who support the ashmem driver. > > > > Thanks for looping me in. >

Re: possible deadlock in shmem_fallocate (4)

2020-07-14 Thread Suren Baghdasaryan
On Tue, Jul 14, 2020 at 8:47 AM Todd Kjos wrote: > > +Suren Baghdasaryan +Hridya Valsaraju who support the ashmem driver. Thanks for looping me in. > > > On Tue, Jul 14, 2020 at 7:18 AM Michal Hocko wrote: > > > > On Tue 14-07-20 22:08:59, Hillf Danton wrote: > > > > > > On Tue, 14 Jul 2020 10:

Re: possible deadlock in shmem_fallocate (4)

2020-07-14 Thread Hillf Danton
On Tue, 14 Jul 2020 10:26:29 +0200 Michal Hocko wrote: > On Tue 14-07-20 13:32:05, Hillf Danton wrote: > > > > On Mon, 13 Jul 2020 20:41:11 -0700 Eric Biggers wrote: > > > On Tue, Jul 14, 2020 at 11:32:52AM +0800, Hillf Danton wrote: > > > > > > > > Add FALLOC_FL_NOBLOCK and on the shmem side t

Re: possible deadlock in shmem_fallocate (4)

2020-07-14 Thread Michal Hocko
On Tue 14-07-20 22:08:59, Hillf Danton wrote: > > On Tue, 14 Jul 2020 10:26:29 +0200 Michal Hocko wrote: > > On Tue 14-07-20 13:32:05, Hillf Danton wrote: > > > > > > On Mon, 13 Jul 2020 20:41:11 -0700 Eric Biggers wrote: > > > > On Tue, Jul 14, 2020 at 11:32:52AM +0800, Hillf Danton wrote: > > >

Re: possible deadlock in shmem_fallocate (4)

2020-07-14 Thread Michal Hocko
On Tue 14-07-20 13:32:05, Hillf Danton wrote: > > On Mon, 13 Jul 2020 20:41:11 -0700 Eric Biggers wrote: > > On Tue, Jul 14, 2020 at 11:32:52AM +0800, Hillf Danton wrote: > > > > > > Add FALLOC_FL_NOBLOCK and on the shmem side try to lock inode upon the > > > new flag. And the overall upside is t

Re: possible deadlock in shmem_fallocate (4)

2020-07-13 Thread Hillf Danton
On Mon, 13 Jul 2020 20:41:11 -0700 Eric Biggers wrote: > On Tue, Jul 14, 2020 at 11:32:52AM +0800, Hillf Danton wrote: > > > > Add FALLOC_FL_NOBLOCK and on the shmem side try to lock inode upon the > > new flag. And the overall upside is to keep the current gfp either in > > the khugepaged conte

Re: possible deadlock in shmem_fallocate (4)

2020-07-13 Thread Eric Biggers
On Tue, Jul 14, 2020 at 11:32:52AM +0800, Hillf Danton wrote: > > Add FALLOC_FL_NOBLOCK and on the shmem side try to lock inode upon the > new flag. And the overall upside is to keep the current gfp either in > the khugepaged context or not. > > --- a/include/uapi/linux/falloc.h > +++ b/include/u

Re: possible deadlock in shmem_fallocate (4)

2020-07-13 Thread Hillf Danton
Mon, 13 Jul 2020 17:32:19 -0700 > syzbot has found a reproducer for the following crash on: > > HEAD commit:11ba4688 Linux 5.8-rc5 > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=13f1bf4710 > kernel config: https://syzkaller.appspot.com/x/.config?x

Re: possible deadlock in shmem_fallocate (4)

2020-07-13 Thread syzbot
syzbot has found a reproducer for the following crash on: HEAD commit:11ba4688 Linux 5.8-rc5 git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=175391fb10 kernel config: https://syzkaller.appspot.com/x/.config?x=a160d1053fc89af5 dashboard link: https://syzk

Re: possible deadlock in shmem_fallocate (4)

2020-07-13 Thread syzbot
syzbot has found a reproducer for the following crash on: HEAD commit:11ba4688 Linux 5.8-rc5 git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=13f1bf4710 kernel config: https://syzkaller.appspot.com/x/.config?x=a160d1053fc89af5 dashboard link: https://syzk

Re: [ashmem] possible deadlock in shmem_fallocate (4)

2020-03-07 Thread Eric Biggers
ashmem is calling shmem_fallocate() during memory reclaim, which can deadlock on inode_lock(). +Cc maintainers of drivers/staging/android/ashmem.c. On Thu, Dec 26, 2019 at 01:25:09PM -0800, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:46cf053e Linux 5.5-rc