From patchwork Wed Sep 25 15:18:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milosz Tanski X-Patchwork-Id: 2942641 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 160D19F288 for ; Wed, 25 Sep 2013 15:18:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FA0520257 for ; Wed, 25 Sep 2013 15:18:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C15282024A for ; Wed, 25 Sep 2013 15:18:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755979Ab3IYPR6 (ORCPT ); Wed, 25 Sep 2013 11:17:58 -0400 Received: from mail-ea0-f170.google.com ([209.85.215.170]:61009 "EHLO mail-ea0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755759Ab3IYPR5 (ORCPT ); Wed, 25 Sep 2013 11:17:57 -0400 Received: by mail-ea0-f170.google.com with SMTP id h14so3272026eak.15 for ; Wed, 25 Sep 2013 08:17:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=KQSQkWDHNdbXk/G1Ahl8L7ulrj1PR5NvfQSVWGuOlzo=; b=RzvBvwh7MnesMoiwyf8CRz4+V+h8SRtlgLhHIh6dX96pwNSH9yzj1P/QhBb6hREgk7 pq9UrqOVrn9qJvkItk7o/9mv2gR9aqxPQr+2tOZVzAdR5rWxhIWxhroNnyj/Zs9u+Fxw zF+Xd+xeFyrQa8cmcGsse2A6MpVcCjCH2xm4IbT+cPXAnI2giawMzAsoJIYpZ7JqvSi7 gmJng44AuLpSn3q0mrvvNTnCLZbiqPH7YGIkE3IlRk96Sr+hnyxioM7ZRShkVFlABoI1 bVSq+7HWQLBXVhm9A14UvEpPPBncxgsAJEwhUAoHc3G2PETKAyO1NF2umVaI1CgfHljm x5VQ== X-Gm-Message-State: ALoCoQnCuYhjJJFC85HYH1aTEqAscEh83b/iqh5FgdxMLxNdFBPFvNsZTye0AYQihtk6tOsdo7/I X-Received: by 10.14.108.9 with SMTP id p9mr56347030eeg.8.1380122276091; Wed, 25 Sep 2013 08:17:56 -0700 (PDT) Received: from gmail.com ([69.193.178.202]) by mx.google.com with ESMTPSA id h52sm66584857eez.3.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 25 Sep 2013 08:17:55 -0700 (PDT) Date: Wed, 25 Sep 2013 11:18:14 -0400 From: Milosz Tanski To: ceph-devel@vger.kernel.org Cc: sage@inktank.com, zheng.z.yan@intel.com, dhowells@redhat.com, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ceph: hung on ceph fscache invalidate in some cases Message-ID: <20130925151811.GA32800@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In some cases I'm on my ceph client cluster I'm seeing hunk kernel tasks in the invalidate page code path. This is due to the fact that we don't check if the page is marked as cache before calling fscache_wait_on_page_write(). This is the log from the hang INFO: task XXXXXX:12034 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. ... Call Trace: [] schedule+0x29/0x70 [] __fscache_wait_on_page_write+0x6d/0xb0 [fscache] [] ? add_wait_queue+0x60/0x60 [] ceph_invalidate_fscache_page+0x29/0x50 [ceph] [] ceph_invalidatepage+0x70/0x190 [ceph] [] ? delete_from_page_cache+0x5f/0x70 [] truncate_inode_page+0x8b/0x90 [] truncate_inode_pages_range.part.12+0x13d/0x620 [] truncate_inode_pages_range+0x4d/0x60 [] truncate_inode_pages+0x15/0x20 [] evict+0x1a6/0x1b0 [] iput+0x103/0x190 ... Signed-off-by: Milosz Tanski --- fs/ceph/cache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c index 6bfe65e..360b622 100644 --- a/fs/ceph/cache.c +++ b/fs/ceph/cache.c @@ -324,6 +324,9 @@ void ceph_invalidate_fscache_page(struct inode* inode, struct page *page) { struct ceph_inode_info *ci = ceph_inode(inode); + if (!PageFsCache(page)) + return; + fscache_wait_on_page_write(ci->fscache, page); fscache_uncache_page(ci->fscache, page); }