From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f195.google.com ([209.85.210.195]:35996 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725736AbeHCEqj (ORCPT ); Fri, 3 Aug 2018 00:46:39 -0400 Date: Fri, 3 Aug 2018 11:52:30 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky Cc: Andrew Morton , Minchan Kim , LKML , Tino Lehnig , stable@vger.kernel.org, Jens Axboe Subject: Re: [PATCH 1/2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature Message-ID: <20180803025230.GA502@jagdpanzerIV> References: <20180802051112.86174-1-minchan@kernel.org> <20180802141304.d0589ddc5f8213429ab3b565@linux-foundation.org> <20180803023929.GA7500@jagdpanzerIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180803023929.GA7500@jagdpanzerIV> Sender: stable-owner@vger.kernel.org List-ID: On (08/03/18 11:39), Sergey Senozhatsky wrote: > [..] > > > A reader looking at this would wonder "why the heck are we doing that". > > Adding a code comment would help them. > > The interesting thing here is that include/linux/backing-dev.h > BDI_CAP_SYNCHRONOUS_IO comment says > > "Device is so fast that asynchronous IO would be inefficient." > > Which is not the reason why BDI_CAP_SYNCHRONOUS_IO is used by ZRAM. > Probably, the comment needs to be updated as well. > > Both SWP_SYNCHRONOUS_IO and BDI_CAP_SYNCHRONOUS_IO tend to pivot > "efficiency" [looking at the comments], but in ZRAM's case the whole > reason to use SYNC IO is a race condition and user-after-free that ^ASYNC IO -ss