Message ID | 1528911866-37489-4-git-send-email-anton.nefedov@virtuozzo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 85200603B4 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 13 Jun 2018 17:50:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71E7328D7D for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 13 Jun 2018 17:50:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6525A28F69; Wed, 13 Jun 2018 17:50:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DFFF128F63 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 13 Jun 2018 17:50:32 +0000 (UTC) Received: from localhost ([::1]:35978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1fT9ui-0007Jc-5S for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Jun 2018 13:50:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1fT9pF-0003LE-Hg for qemu-devel@nongnu.org; Wed, 13 Jun 2018 13:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1fT9pD-00073t-Vf for qemu-devel@nongnu.org; Wed, 13 Jun 2018 13:44:53 -0400 Received: from mail-eopbgr10138.outbound.protection.outlook.com ([40.107.1.138]:47432 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1fT9pD-0006sA-Mb; Wed, 13 Jun 2018 13:44:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ehEwT1B0wYmW5QJmKAydy1DSIvVFbb+jguOs6OQpYW0=; b=K9NS7Tfr9QWnXLxMS9OznZULqRiANHXjufqupt5cAIxpX/XpKwHZ0oMvnKBhhAqUGLCa/Rt2x3z6A4HAc+6y0/DfpPbqtfWjf8JA+mS64xKkA80/Bx2ytRE54MnEDC5No3rohF3MoIoT/txNiMqJoeVR9GkN8GvhuUepwaGFpSE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Wed, 13 Jun 2018 17:44:48 +0000 From: Anton Nefedov <anton.nefedov@virtuozzo.com> To: qemu-devel@nongnu.org Date: Wed, 13 Jun 2018 20:44:21 +0300 Message-Id: <1528911866-37489-4-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528911866-37489-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1528911866-37489-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0902CA0023.eurprd09.prod.outlook.com (2603:10a6:3:e5::33) To AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3aeb4c5a-23dd-4f95-f20b-08d5d1555c1a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3347; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 3:97NQluuCbmpZcWKQcEIW64un32O7I72sOqQH5LbDZ9PM5uPC4xUsyS6e3zs1yOgYFaoVb2uk1hwWvWuzrtpbDaLkQxIPtbDfSZkh9zVfuDiZu5Rgj6Tl53RAfz7NmYj3qm9fz/DkaDew4ETtXHHio8Yqy8wgA5x0hCGjo9CXdYEI5XnNh8lDWK7qjXIK9RC+90SnqubmADheLG9E6WVNjahn6P43T5EIhR/0SIP92f+hYo2k09MQb/VYhTzG8BO1; 25:JSnM62uv7Ge/A7AivtXhxVj4vJKQdt1sWM73mu2eFCyBJGcrADyWJTG/i8Hx++2fD0YIF4q+GkcXbF2/ZiZVXwL5oNBRHdV1BZSrPJVOUrZvp3q3aEMLYFfhBVyllD0JD8CsMi3/RQ3c0TmLtzvhy4cgusPYfwXTVemBmwm3aRYhX2Si7+334Osv6eiceGAjBax9094ivCOp5tsBvw2keHEF64VP4TQoLLX/VsjMdRSMjScBjtt+xKMIOWW5xU6k9XBmUe0axLqwlK/Kpmq7mrF9k1LGAcWdrAtGS586DckNv+T28Y8ly/iIsw6YO25HI2LaX2aProeDMX6NTxs+mQ==; 31:Qkg/6xJDpsUXGX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== X-Microsoft-Antispam-PRVS: <AM0PR08MB33473F5FD1DB1B55A3575135F87E0@AM0PR08MB3347.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:AM0PR08MB3347; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3347; X-Forefront-PRVS: 07025866F6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(346002)(376002)(39850400004)(366004)(39380400002)(199004)(189003)(50466002)(2351001)(386003)(4326008)(2361001)(6512007)(52116002)(105586002)(486006)(478600001)(106356001)(44832011)(53416004)(107886003)(51416003)(53936002)(76176011)(11346002)(956004)(446003)(2616005)(476003)(69596002)(6486002)(48376002)(16526019)(6506007)(7736002)(97736004)(186003)(5660300001)(6666003)(25786009)(6916009)(305945005)(8936002)(6116002)(3846002)(50226002)(66066001)(36756003)(8676002)(86362001)(47776003)(55236004)(68736007)(316002)(2906002)(16586007)(81166006)(26005)(81156014); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3347; H:xantnef-ws.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3347; 23:Gpequ20UYmoG0/ayUv8A336VUOeu9jUjyCK4Xj4TV?= =?us-ascii?Q?OVCE/Pq2oZnii/OOn9BHclQI8ZZ6anYrrWn3jb6sa2hOrKtJl6A7SYMfybzv?= =?us-ascii?Q?DfJvXUm7NxhZLd89K/LHV5nFuAKet1nI6qMkoCEsYSSd510uQ1i0K9XmiOwG?= =?us-ascii?Q?IgvGS5N9d4SEzliCjMqZONoBsdWROyA60w6UfKHCQoHn3kyHqlj3BVoXxP2p?= =?us-ascii?Q?A63lFjMrMJJfWjVsag7zu4Qxu4MZoIeOzXqyQDyFe4KOKb1XYjk1inVXCc+K?= =?us-ascii?Q?oNWizt4j5GjovJN+II0m73BJ8RzyaVa9m4/0lmOvrgu/ETGKB3Y6d320aLfC?= =?us-ascii?Q?DndQS6spZR4o6ZTIs733IMWlc/Kj/dy62BXfsdCViR9t93XwRXHSGCqKGual?= =?us-ascii?Q?b5AsahFN6AXV2aK99/tY9uFDY9wReB6f77XuVg7MkT8p/h3bURovsv06X1O9?= =?us-ascii?Q?dSqFhRSgS3UdR9Ehc6UOD01zQgMz1baI8HZP9RVxIOUICHJTTpzCxKRoJIBN?= =?us-ascii?Q?r/TpNNOgHLw1OdhNNx20N+G68sNR47SCc3n7e/5Q36z6CzShpu6wBxdso9jt?= =?us-ascii?Q?V54Um8dCehT+AfTiL0/JM/Nqd8M4+f0SshqIoBkIYapB17+hrveTq2j96Kpp?= =?us-ascii?Q?HzHGrlrbqldh/vqIKu+/Otwugum7tYln2h7yWtOLnol6myp8pBVQ0l6pteAl?= =?us-ascii?Q?etHnWNtiWCHW5yFb1o7BLaUefNgc6z336FDMXtEkPAMMKppxGEbmAhYtQaC3?= =?us-ascii?Q?7DkF9GaZlRuT3mcTGTDq942MQnBXW2F6wnvrpPq/vp2TxnuBjtL/REUfkV64?= =?us-ascii?Q?depmyXNQ5dGeUmpMgQ1rM4jplk097z71FaxKrfzflbd215cXQr6IGYARIIpz?= =?us-ascii?Q?lj8ivy38uEkDyePHp3HofxFAhmMYK229TdBS7Fa5Vnp33EB3mXMtLA9DA0y+?= =?us-ascii?Q?BFoXquOi+hsGWkkTtDvLd2o5Ndxf7ayHuqRXqOgC7Te5B5frD/4I1PRE6nmt?= =?us-ascii?Q?6spqe8ZLoTbrmNgOOOXKOAI0bLDkNlL//BfNQHUGLD8DhtQerO5vqHGNGEV9?= =?us-ascii?Q?S72cYMbzD1gFs37iTto7N8zAAF5qYJbn8hMAc10pYEj1QMld2CFfUWFcaieF?= =?us-ascii?Q?/JjvxlOz3AhwGkrnlOrp3hKlWfjOJXZ8LydMETUqTe4If0RMvTpEmtpwLFhk?= =?us-ascii?Q?GrJyNHm2LeGk9RdMZ0jjOWww3H9+gAMR1M0TccV0tYwUrL0B3wMCXmVhvEfE?= =?us-ascii?Q?0oYTSgN8FDW88BXA3ut7CCWTyJmUj4osVt/B6HxPM+yb9pUrjfW2ZKiSNvqJ?= =?us-ascii?Q?jochgl+Lsx5dLV4fcMSuXk=3D?= X-Microsoft-Antispam-Message-Info: IX7VdZlIgJoZG0f0zu+rB2R2DEvbt8Eqi5KZEnxwzYrImhf+YPKgT6aLjlQD+H6SUgupd0hJ0E743pNj68fRePzoymiIElBOj7Q0nXP42bpne6vUl2MYmNK86E0hczuBKeNDN9fEqHVAr1/t04n4jGk7oN1DdBFB6qEqHbf0bWGjwYTOv0o1VkAwayRjGXlz X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 6:yS9yToSO790c9Rix9mtFQCYjHrmnXBa7cDorkXUS5RyjgiJ/pZlB1YFwjw85acrJF0NF/LnLvpZEjZXcJnO5flndd+jNw1AuF0vB8qM/mxvPolqTmpwk5ltrZhOhzNWySrux/cd+H4AHBoihhGf+To17Y+cPkHZpLdyQupj71ArtOrqGeALXza3RS1Ekn8cixYdkAYabS+y0x+SgbFKSj+kvogIUtG1IIwTLfppskgtC9/RQneNUUt9mRMVrwWXWljvyEzwONUicCb612Z2gJjeps9Wi6Xz/45RBus01lk5NlPX3Cuuz1OrVLIPmPE13FyD7IC3ys6/w3MXhxk0whip7SNvlJdexVvOjOiHyn79W4JVxaJBWC8QuyM/8tMI80oV8onJzvtVtIXw4Jqe7TiQLlgwx3m18Wera5Ny2iXLpZ4V2U0pH/PNwwILdbGLcoZoffWXENwwoXtZd1sIjRw==; 5:J7Z3kdxlTQRM2iT568ulhzhuwu47xA2RdMARP47tjXdy8R1wyK/rSzn+hMQ9BsPze066QefQ36m6UZSgCpI6W4E4Hw6Omd2Pi5x8f/QlXuxdZi4J96sh1/CCBumLgWS0VvuMxQ2biz/RM/XziMMan+2otuHKFd5Envfiz743BLI=; 24:AQSeaZE2VeIGkbq9dka+K/USAaKlQPapzMgi10Ub8tHkN23l4wxfFBztVSMJF9cBEw6EEBhlJPHFnczjphcb6/WcKi+GHNAOr4vlCUxqW6k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 7:16ttKl7KLBVy9yb2mXKlZ2SmIUKlFx4dlPiVj07GT/G5gf9HOp3OfPY2BbmAyX6dltIWYReYKmXPjudAiZ88g1V68N9xO+mxycgxm++SJ8RcaUy3XSuGEdAahBFWAeInDiuOB+NJ1kQYK7AN/DV0FKaJIqYCuhXhCaapCJGWNMhVehFVDfH/92ZotV+e+qeLlQ0JeUOus3kGQ1orFITQFKjD9LWzXoHUi2i86EzQATNYxItLPoQuIwieq3caT6IH; 20:cPBC4en+iBmhvJ/uqXf8oTbs97x+23l3HHSiZ8r/XxCzlHf7WNEfWrCI97eXUBwlf3/RAHSvqikpbPKhmmnSHkbtTQdHjPkDMVWXADnW+l/jdR95ieIyf2NSO6dBFQ7RGvn2Q5N1/jc+G9M3wddvJIqw9MNe+wVyJ/cdpTx+9xU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2018 17:44:48.2983 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3aeb4c5a-23dd-4f95-f20b-08d5d1555c1a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3347 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.1.138 Subject: [Qemu-devel] [PATCH v3 3/8] ide: account UNMAP (TRIM) operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, Anton Nefedov <anton.nefedov@virtuozzo.com>, berto@igalia.com, den@virtuozzo.com, qemu-block@nongnu.org, armbru@redhat.com, mreitz@redhat.com, pbonzini@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
On Wed 13 Jun 2018 07:44:21 PM CEST, Anton Nefedov <anton.nefedov@virtuozzo.com> wrote: > Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Berto
diff --git a/hw/ide/core.c b/hw/ide/core.c index 2c62efc..352429b 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -440,6 +440,14 @@ static void ide_issue_trim_cb(void *opaque, int ret) TrimAIOCB *iocb = opaque; IDEState *s = iocb->s; + if (iocb->i >= 0) { + if (ret >= 0) { + block_acct_done(blk_get_stats(s->blk), &s->acct); + } else { + block_acct_failed(blk_get_stats(s->blk), &s->acct); + } + } + if (ret >= 0) { while (iocb->j < iocb->qiov->niov) { int j = iocb->j; @@ -461,6 +469,9 @@ static void ide_issue_trim_cb(void *opaque, int ret) goto done; } + block_acct_start(blk_get_stats(s->blk), &s->acct, + count << BDRV_SECTOR_BITS, BLOCK_ACCT_UNMAP); + /* Got an entry! Submit and exit. */ iocb->aiocb = blk_aio_pdiscard(s->blk, sector << BDRV_SECTOR_BITS, @@ -845,6 +856,7 @@ static void ide_dma_cb(void *opaque, int ret) } if (ret == -EINVAL) { + block_acct_invalid(blk_get_stats(s->blk), BLOCK_ACCT_UNMAP); ide_dma_error(s); return; }
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> --- hw/ide/core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)