From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3A82C433DB for ; Fri, 26 Feb 2021 20:51:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 404DA64F13 for ; Fri, 26 Feb 2021 20:51:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 404DA64F13 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9A8CF8D000D; Fri, 26 Feb 2021 15:51:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 957808D0001; Fri, 26 Feb 2021 15:51:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86CDC8D000D; Fri, 26 Feb 2021 15:51:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id 707E98D0001 for ; Fri, 26 Feb 2021 15:51:50 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2BB19180AD801 for ; Fri, 26 Feb 2021 20:51:50 +0000 (UTC) X-FDA: 77861615580.24.173512C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP id 6FBF3600249F for ; Fri, 26 Feb 2021 20:51:43 +0000 (UTC) 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=+udi+amsuo05IzVe+P9jhzY7ydKiUiOHNE7tYtPijPo=; b=ltlrfKs/tgZ+46eyE+BCDfcOCA J7sUTEbAy8u8GPVXJccQYwlZhFGRrVORtpHlHks86G1tlin3p59e3/ktqx0wrS0ACz/jYWQ8HI0z7 n0axc0QzaKGM2mcAAorWuF5uV8szCENe4rFvjMO/FFgu2FdNtDWLm135bq/WbuL6VmFoXXd29gRmD b/wF9uWCrtVgzHcHlh+lq+2q5OQKhacw6WGgJCXbpPvVoU1bJf1Eur3yO6ICpVQ1pENRQ95SjS0Df Xy/Ia17eYdw/0k2eDBDdRKL258S+VZE8l3+RAtmucbmUCxzPoDH7ftwuOESeneQvafc/Xc/WD6Bwi CDdOU5iw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lFk5L-00CUjl-2O; Fri, 26 Feb 2021 20:51:41 +0000 Date: Fri, 26 Feb 2021 20:51:39 +0000 From: Matthew Wilcox To: OGAWA Hirofumi Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH] Fix zero_user_segments() with start > end Message-ID: <20210226205139.GI2723601@casper.infradead.org> References: <87eeh2erm0.fsf@mail.parknet.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87eeh2erm0.fsf@mail.parknet.co.jp> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6FBF3600249F X-Stat-Signature: 9ouizwpiwe5af5k3ish1sxokwby8tpy7 Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614372703-655287 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Feb 27, 2021 at 01:11:35AM +0900, OGAWA Hirofumi wrote: > zero_user_segments() is used from __block_write_begin_int(), for > example like the following > > zero_user_segments(page, 4096, 1024, 512, 918) > > But new zero_user_segments() implements for HIGMEM + TRANSPARENT_HUGEPAGE > doesn't handle "start > end" case correctly, and hits BUG_ON(). (we > can fix __block_write_begin_int() instead though, it is the old and > multiple usage) Why don't we just take out the BUG_ON instead? The function doesn't actually do the wrong thing. > Also it calls kmap_atomic() unnecessary while start == end == 0. I'm OK with that. It always used to do that. > Cc: > Signed-off-by: OGAWA Hirofumi Fixes: 0060ef3b4e6d ("mm: support THPs in zero_user_segments")