Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1186635imj; Thu, 14 Feb 2019 02:38:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IYkhEJUBFGbwGeXQBbZezFFZImv/xSlVEk4xCCw4MWxKSBh+42iUL4nCTgpXdBXrujqGq8z X-Received: by 2002:a63:d342:: with SMTP id u2mr3071305pgi.41.1550140688043; Thu, 14 Feb 2019 02:38:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550140688; cv=none; d=google.com; s=arc-20160816; b=svGPEgr6ro4AJrwWc0DFGyp5NZKBufsxN8/Lf3uZt5DocgOLPnS0xYbLc3edo2JRcw wsgfh3G50rvFE/rYtLf6NnDNyHKAZAXbgz+PFjl5CWE9rSB7lEjKib+cpiC8o6VAxM1Y b/sBsfw2K5sDz4cuXtL8gRVCc0eJ3n/0LkRzBJLi824RW7wlyRrYZ7jf30qCTP6V4StI O5A02pGcKnFytWiKi1EGt6ZI50lTLRduK7BOqZlHBxEBqpCbbFrYRwWkRpMKtoDnRWYy FsyT2qwvbr355wufOwsWHQ901DO41ZBAxO4k3wgRVj0iqaBYdlB9/LCoT8faLSAkHT3A qy4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature; bh=LwB5hh0FheSm+snXyf4ObgxM0IXBXnHxQeNUTE7dtwg=; b=HShCXPmQRrcr3FZbvDPTm6WFFd3Ma+jDun6VnPjH9l0gc9SWY6iXEeXX9RvOnEfSxf 2G3n9SjBxeQ3YgJTq4XVrvoGQAVlHc6fGh6/lbOaQJRl1NgPiUms6pdHb2VEiN/khULl MIjlS7WNeE4/79sE8CeEbmsqE6ZhXjSDoNt99ZrB+CQu3S5HTWKXYJh5MiJ9tGro1B7f SQXgbwzJBN5l7NCY5uZjoilSErK/8QsOr+PKlKzv+yaede3NbuP5SqFW9hv/CyCknHm0 luLhQ6unNZHkTXfmRdvcN5wwsQ1MbeoP+Cpzxff+XwLKDJCefYVZdaE4X0DxE8XPWPfT 0UKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=wYJW99JV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si2058501pll.179.2019.02.14.02.37.48; Thu, 14 Feb 2019 02:38:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=wYJW99JV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393340AbfBNCkC (ORCPT + 99 others); Wed, 13 Feb 2019 21:40:02 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:40564 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbfBNCkB (ORCPT ); Wed, 13 Feb 2019 21:40:01 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1E2dMSs010721; Thu, 14 Feb 2019 02:39:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2018-07-02; bh=LwB5hh0FheSm+snXyf4ObgxM0IXBXnHxQeNUTE7dtwg=; b=wYJW99JVLOT7YemNn7uv6TIwDciYMsOedRfM5B0+cceNOzS3/23inAX4J6fZVDpWLrM7 sUX2eKdfuyYm9UFaIuSZ/NpYPIOQylclnmWCHSmf6YsBqMU3sgf7opyLUJ5JN0tiQy8/ SmRY7PFoonkYh2mHsvjgV86zWkMtlyf1njkyq3OcjfPJ4gpM8AXFF5MbsK9Eu4TK602J ByE+lqV7OPVN7lKS/gxkrCFKBavhtgQs/+Jmhkt4qNcG9Qm5aP4emwmJcp0zpHtQSGqe 9Hbrkl714jnjkwNCfG4eVtcwWGpqd54IC9A5XhmQFTHL9e290fKW5BdyjOawfsD73dc1 4w== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2qhre5neu2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Feb 2019 02:39:54 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x1E2dsd0031412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Feb 2019 02:39:54 GMT Received: from abhmp0022.oracle.com (abhmp0022.oracle.com [141.146.116.28]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x1E2drIB008945; Thu, 14 Feb 2019 02:39:53 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 13 Feb 2019 18:39:53 -0800 To: Evan Green Cc: Jens Axboe , Bart Van Assche , Gwendal Grignou , Martin K Petersen , Alexis Savery , Ming Lei , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] loop: Better discard support for block devices From: "Martin K. Petersen" Organization: Oracle Corporation References: <20190207205730.199332-1-evgreen@chromium.org> <20190207205730.199332-3-evgreen@chromium.org> Date: Wed, 13 Feb 2019 21:39:50 -0500 In-Reply-To: <20190207205730.199332-3-evgreen@chromium.org> (Evan Green's message of "Thu, 7 Feb 2019 12:57:29 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9166 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=725 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902140018 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Evan, > If the backing device for a loop device is a block device, then mirror > the discard properties of the underlying block device into the loop > device. While in there, differentiate between REQ_OP_DISCARD and > REQ_OP_WRITE_ZEROES, which are different for block devices, but which > the loop device had just been lumping together. Bubbling up the queue limits from the backing device is fine. However, I'm not sure why you are requiring a filesystem to be on a discard-capable device for REQ_OP_DISCARD to have an effect? Punching a hole in a file is semantically the same as discarding. -- Martin K. Petersen Oracle Linux Engineering