From patchwork Thu May 14 14:40:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 48508 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1FC462121F for ; Thu, 14 May 2015 14:40:45 +0000 (UTC) Received: by labgx2 with SMTP id gx2sf21000735lab.1 for ; Thu, 14 May 2015 07:40:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:content-type:content-transfer-encoding :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=hG9ihB//TPBcUo7QBifMHOGa++yskDKEUZ6/y6tWWyA=; b=cUsyPG8YtJF4bxctnRoqHcHVVv6UKcNdu9GgaC+23PHUjgl4LDS0pvcSHyAIN/S0cL D6yccwCqBncQ+hXz3ksOUrzneo6KL1jHcXsHqNK0nkz1vcMnbnnBEoWhO9Yv3OPuOQm6 uaypnnGg7/d2W3VlK0enlWBcZIvsd93PWPMGpwe5CwlKXHdlZv7uYPCBeGcvF9rdF9Us v/FIpSEk38vT8IUXMtRct4UPC9xh4pzE0mYDQpfLefSVxkUhnLcgAprpDwrnnTgdeZBw vShnbwj4oiXq79ttTp4WzHjBnQ8DxjOiccxIg+giF8CkbG77ZpIJCJD2RhthsKtWyAmd WD2A== X-Gm-Message-State: ALoCoQnX8GV9ixkHgFOELeQbOtuDFJqNsoixeUPe/X+uID2kPua48AN6sH5tLSWIPc9KHbTI/Vel X-Received: by 10.180.105.67 with SMTP id gk3mr9871174wib.4.1431614443990; Thu, 14 May 2015 07:40:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.42 with SMTP id u10ls381067laz.64.gmail; Thu, 14 May 2015 07:40:43 -0700 (PDT) X-Received: by 10.152.26.3 with SMTP id h3mr3407684lag.69.1431614443828; Thu, 14 May 2015 07:40:43 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id ca5si14689159lad.28.2015.05.14.07.40.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 07:40:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by layy10 with SMTP id y10so70850519lay.0 for ; Thu, 14 May 2015 07:40:43 -0700 (PDT) X-Received: by 10.112.150.100 with SMTP id uh4mr3407752lbb.112.1431614443710; Thu, 14 May 2015 07:40:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1317787lbb; Thu, 14 May 2015 07:40:42 -0700 (PDT) X-Received: by 10.66.231.42 with SMTP id td10mr8718121pac.98.1431614441949; Thu, 14 May 2015 07:40:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ek10si23528502pdb.228.2015.05.14.07.40.41; Thu, 14 May 2015 07:40:41 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751830AbbENOkk (ORCPT + 2 others); Thu, 14 May 2015 10:40:40 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:34277 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751090AbbENOkj (ORCPT ); Thu, 14 May 2015 10:40:39 -0400 Received: by pacyx8 with SMTP id yx8so87876430pac.1 for ; Thu, 14 May 2015 07:40:38 -0700 (PDT) X-Received: by 10.66.145.33 with SMTP id sr1mr8638448pab.41.1431614438751; Thu, 14 May 2015 07:40:38 -0700 (PDT) Received: from [192.168.20.1] ([162.243.130.63]) by mx.google.com with ESMTPSA id fm3sm22653085pdb.28.2015.05.14.07.40.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 07:40:38 -0700 (PDT) Message-ID: <5554B3E3.6090407@linaro.org> Date: Thu, 14 May 2015 22:40:35 +0800 From: Alex Shi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Dmitry Monakhov , Theodore Ts'o , Jan Kara , Linaro Kernel CC: stable@vger.kernel.org Subject: a old issue of ext4 on lts 3.10 Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.shi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi Dmitry&Theodore, Someone said without the following patch on lts 3.10 kernel (which used as android base kernel). the write maybe very very slow, needs 1 or 2 seconds to finish. I quick looked this patch, seems it's no harm for a normal fs function. but still don't know why it is helpful. So do you remember why you commit this change at that time? Thanks Alex ommit 7afe5aa59ed3da7b6161617e7f157c7c680dc41e Author: Dmitry Monakhov Date: Wed Aug 28 14:30:47 2013 -0400 ext4: convert write_begin methods to stable_page_writes semantics Use wait_for_stable_page() instead of wait_on_page_writeback() Signed-off-by: Dmitry Monakhov Signed-off-by: "Theodore Ts'o" Reviewed-by: Jan Kara ext4_get_block_write); @@ -2678,7 +2679,7 @@ retry_journal: goto retry_grab; } /* In case writeback began while the page was unlocked */ - wait_on_page_writeback(page); + wait_for_stable_page(page); ret = __block_write_begin(page, pos, len, ext4_da_get_block_prep); if (ret < 0) { ~ diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index fc4051e..47c8e46 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -969,7 +969,8 @@ retry_journal: ext4_journal_stop(handle); goto retry_grab; } - wait_on_page_writeback(page); + /* In case writeback began while the page was unlocked */ + wait_for_stable_page(page); if (ext4_should_dioread_nolock(inode)) ret = __block_write_begin(page, pos, len,