Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2472307ybg; Fri, 31 Jul 2020 00:00:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA+zU7OqysKnZi9/JeR6YNvHO4aIGRARcIYusm+ryeIx2DwcOyoUhe3qrzEHfSidfaSuM2 X-Received: by 2002:a17:906:46c6:: with SMTP id k6mr2500476ejs.230.1596178844323; Fri, 31 Jul 2020 00:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596178844; cv=none; d=google.com; s=arc-20160816; b=t4o7dZr01YHCOPhscjyKdblGy0qhw8/IxR11ckHiDNLR1odWVH+kpOyce/pag8tBqp xnKOFI3909JvIznjdXev+W6434JbYGDQT6inf+NZT6Bt5QVA/1WHDkjuRJOzESmSmwPD aKIfXVEintCk3bi9VqRlPbQByf/+yJ5cdaHRN9Y+HK4QeexFJcGiYha4J2zEvFrUfeJY ewSdHd8YqT+atNp/VLN+bxXJIm0T+G2S3IOvjYA2BRAnrFGrV2NBcl58U4HI0F0YvobX ybjBLpjQ4d2l36wVoYijfpcD40Lx13tgeb4pLgoaDlZ5XbLXtnDKfYbwNSbzygpX3Oug rFJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lDee4pOFLZSB3nuhpAPdiW8K8t8auXkIPj1PU+i4wwU=; b=rcReRvT8J5QAFiCjrW/iio9kqjQfjJodUlHJOQT9oDwvlc54UO54rA79919R8uy9bl v5Kmfcsy1TK1prAsQao3bSCZlaFDZqNa90wTB81YQMYSlP0GYi+NOQZI+TUjMiOrkM6+ WLIrkqcgvKkqTtd+9iwwxR/9+uTDpn35RCEf3EU9NvHRAsaSbR9Yx7V07sQHhweswQFH Q4UStZZsCTQ3c6lZ+Riz6QXFbwONR9ZdGA8Yy5671Tsuxolj+RN/BDMMtDUIL90OKMJn WDmxukM6eUZjmPQl0SKFvKshtBYXbogPwA2q4VySO63IjlELxV8Y+tXoLnz6nsRosPT6 zTtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=BRwdExN4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si383087ejb.461.2020.07.31.00.00.21; Fri, 31 Jul 2020 00:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=BRwdExN4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731582AbgGaG7w (ORCPT + 99 others); Fri, 31 Jul 2020 02:59:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731566AbgGaG7t (ORCPT ); Fri, 31 Jul 2020 02:59:49 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 692FDC061574; Thu, 30 Jul 2020 23:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lDee4pOFLZSB3nuhpAPdiW8K8t8auXkIPj1PU+i4wwU=; b=BRwdExN41fb4azXzQCAyPVCd3Z VH/lhXhua5z5h8iRo7NB5hzFaL8GkfpxDJX8e7kBGZI0c4W80SeT6UG5xRoyUB2ofgf15DjlNmuCL NbwvefmyLXujmYfQabvNDUuR1H3J4DQmaasi32XE6oBdXI9wNe4vDytUMTT1d73RN+QrSZftXoBuT xMEssx6G8IhE3ekT+rTcModhFaKbea8yO7PKeShsvFsObvlf0/V+sWFaN5a2nEFZCYT27M54QJhYV y/5RuM2Oj0rm1M2POeu8DmIfmil1gwC3ErIib1qwZNLE6dK4HUBl4V9bMpsUIJY+l2oKjr+MhJEam 7L61Kckw==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1P14-0007p7-31; Fri, 31 Jul 2020 06:59:42 +0000 Date: Fri, 31 Jul 2020 07:59:41 +0100 From: Christoph Hellwig To: Matthew Wilcox Cc: Yu Kuai , hch@infradead.org, darrick.wong@oracle.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com Subject: Re: [RFC PATCH] iomap: add support to track dirty state of sub pages Message-ID: <20200731065941.GD25674@infradead.org> References: <20200730011901.2840886-1-yukuai3@huawei.com> <20200730031934.GA23808@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200730031934.GA23808@casper.infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 30, 2020 at 04:19:34AM +0100, Matthew Wilcox wrote: > On Thu, Jul 30, 2020 at 09:19:01AM +0800, Yu Kuai wrote: > > +++ b/fs/iomap/buffered-io.c > > @@ -29,7 +29,9 @@ struct iomap_page { > > atomic_t read_count; > > atomic_t write_count; > > spinlock_t uptodate_lock; > > + spinlock_t dirty_lock; > > No need for a separate spinlock. Just rename uptodate_lock. Maybe > 'bitmap_lock'. Agreed. > > > DECLARE_BITMAP(uptodate, PAGE_SIZE / 512); > > + DECLARE_BITMAP(dirty, PAGE_SIZE / 512); > > This is inefficient and poses difficulties for the THP patchset. > Maybe let the discussion on removing the ->uptodate array finish > before posting another patch for review? I really don't think we can kill the uptodate bit. But what we can do is have on bitmap array (flex size as in your prep patches) and just alternating bits for uptodate and dirty.