From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: [PATCH 2/7] dm: add reserved_rq_based_ios module parameter Date: Thu, 12 Sep 2013 19:15:31 -0400 Message-ID: <20130912231531.GD31577@redhat.com> References: <1379024698-10487-1-git-send-email-snitzer@redhat.com> <1379024698-10487-3-git-send-email-snitzer@redhat.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Mikulas Patocka Cc: dm-devel@redhat.com, Frank Mayhar List-Id: dm-devel.ids On Thu, Sep 12 2013 at 6:45pm -0400, Mikulas Patocka wrote: > I think this is too complicated. > > dm-bufio uses similar approach like this patch - but in dm-bufio the code > path is performance critical, we don't want to recalculate memory size > with each i/o request. > > Here it is not performance critical, so I'd drop the mutex, drop the > latch, drop the function __reserved_request_based_ios_refresh and add only > these lines: > > pool_size = ACCESS_ONCE(reserved_rq_based_ios); > if (!pool_size) pool_size = RESERVED_REQUEST_BASED_IOS; Could be I'm missing something but isn't the locking about correctness rather than performance? Also, using the latch enables the dm_get_reserved_rq_based_ios() interface that is used in patch 5. Mike