Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-05-02 Thread Jens Axboe
On 04/27/2016 07:09 PM, Ming Lei wrote: There were reports about heavy stack use by recursive calling .bi_end_io()([1][2][3]). For example, more than 16K stack is consumed in a single bio complete path[3], and in [2] stack overflow can be triggered if 20 nested dm-crypt is used. Also patches[1]

Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-04-29 Thread Mikulas Patocka
On Fri, 29 Apr 2016, Ming Lei wrote: > > If some block device driver in a process context finds out that it needs > > to terminate a bio, it calls bio_endio in a process context. Why would it > > need to trigger an interrupt just to call bio_endio? (and how could it > > trigger an interrupt if t

Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-04-29 Thread Ming Lei
On Fri, Apr 29, 2016 at 4:39 PM, Mikulas Patocka wrote: > > > On Fri, 29 Apr 2016, Ming Lei wrote: > >> On Fri, Apr 29, 2016 at 12:59 AM, Mikulas Patocka >> wrote: >> > >> > >> > On Fri, 29 Apr 2016, Ming Lei wrote: >> > >> >> On Thu, Apr 28, 2016 at 11:58 PM, Mikulas Patocka >> >> wrote: >> >

Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-04-29 Thread Mikulas Patocka
On Fri, 29 Apr 2016, Ming Lei wrote: > On Fri, Apr 29, 2016 at 12:59 AM, Mikulas Patocka wrote: > > > > > > On Fri, 29 Apr 2016, Ming Lei wrote: > > > >> On Thu, Apr 28, 2016 at 11:58 PM, Mikulas Patocka > >> wrote: > >> > > >> > > >> > On Thu, 28 Apr 2016, Ming Lei wrote: > >> > > >> >> Hi M

Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-04-28 Thread Ming Lei
On Fri, Apr 29, 2016 at 12:59 AM, Mikulas Patocka wrote: > > > On Fri, 29 Apr 2016, Ming Lei wrote: > >> On Thu, Apr 28, 2016 at 11:58 PM, Mikulas Patocka >> wrote: >> > >> > >> > On Thu, 28 Apr 2016, Ming Lei wrote: >> > >> >> Hi Mikulas, >> >> >> >> On Thu, Apr 28, 2016 at 11:29 PM, Mikulas Pa

Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-04-28 Thread Mikulas Patocka
On Fri, 29 Apr 2016, Ming Lei wrote: > On Thu, Apr 28, 2016 at 11:58 PM, Mikulas Patocka wrote: > > > > > > On Thu, 28 Apr 2016, Ming Lei wrote: > > > >> Hi Mikulas, > >> > >> On Thu, Apr 28, 2016 at 11:29 PM, Mikulas Patocka > >> wrote: > >> > > >> > > >> > On Thu, 28 Apr 2016, Ming Lei wrot

Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-04-28 Thread Ming Lei
On Thu, Apr 28, 2016 at 11:58 PM, Mikulas Patocka wrote: > > > On Thu, 28 Apr 2016, Ming Lei wrote: > >> Hi Mikulas, >> >> On Thu, Apr 28, 2016 at 11:29 PM, Mikulas Patocka >> wrote: >> > >> > >> > On Thu, 28 Apr 2016, Ming Lei wrote: >> > >> >> There were reports about heavy stack use by recurs

Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-04-28 Thread Mikulas Patocka
On Thu, 28 Apr 2016, Ming Lei wrote: > Hi Mikulas, > > On Thu, Apr 28, 2016 at 11:29 PM, Mikulas Patocka wrote: > > > > > > On Thu, 28 Apr 2016, Ming Lei wrote: > > > >> There were reports about heavy stack use by recursive calling > >> .bi_end_io()([1][2][3]). For example, more than 16K stack

Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-04-28 Thread Ming Lei
Hi Mikulas, On Thu, Apr 28, 2016 at 11:29 PM, Mikulas Patocka wrote: > > > On Thu, 28 Apr 2016, Ming Lei wrote: > >> There were reports about heavy stack use by recursive calling >> .bi_end_io()([1][2][3]). For example, more than 16K stack is >> consumed in a single bio complete path[3], and in [

Re: [PATCH v3 3/3] block: avoid to call .bi_end_io() recursively

2016-04-28 Thread Mikulas Patocka
On Thu, 28 Apr 2016, Ming Lei wrote: > There were reports about heavy stack use by recursive calling > .bi_end_io()([1][2][3]). For example, more than 16K stack is > consumed in a single bio complete path[3], and in [2] stack > overflow can be triggered if 20 nested dm-crypt is used. > > Also p