From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f67.google.com ([209.85.160.67]:45810 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbeHCEaP (ORCPT ); Fri, 3 Aug 2018 00:30:15 -0400 Date: Fri, 3 Aug 2018 11:39:29 +0900 From: Sergey Senozhatsky To: Andrew Morton Cc: Minchan Kim , LKML , Sergey Senozhatsky , Tino Lehnig , stable@vger.kernel.org, Jens Axboe Subject: Re: [PATCH 1/2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature Message-ID: <20180803023929.GA7500@jagdpanzerIV> References: <20180802051112.86174-1-minchan@kernel.org> <20180802141304.d0589ddc5f8213429ab3b565@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180802141304.d0589ddc5f8213429ab3b565@linux-foundation.org> Sender: stable-owner@vger.kernel.org List-ID: On (08/02/18 14:13), Andrew Morton wrote: [..] > That changelog is rather hard to follow. Please review my edits: > > : If zram supports writeback feature, it's no longer a BD_CAP_SYNCHRONOUS_IO ^BDI_CAP_SYNCHRONOUS_IO [..] > 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 follows. -ss