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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 AD4EEC433E0 for ; Wed, 27 May 2020 17:13:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6E34720890 for ; Wed, 27 May 2020 17:13:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Y0PGGLBO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E34720890 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 E5C688001A; Wed, 27 May 2020 13:13:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E0AA580010; Wed, 27 May 2020 13:13:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF8E68001A; Wed, 27 May 2020 13:13:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id B5F1080010 for ; Wed, 27 May 2020 13:13:56 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7AB1A181AC9CC for ; Wed, 27 May 2020 17:13:56 +0000 (UTC) X-FDA: 76863146472.06.boys52_6108e8d26d53 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 5FAF710059EA7 for ; Wed, 27 May 2020 17:13:56 +0000 (UTC) X-HE-Tag: boys52_6108e8d26d53 X-Filterd-Recvd-Size: 2338 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 May 2020 17:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=VCrAX1Z8lnPF9rXA8L0ry06nQ1+NtToz95+kpBORcnA=; b=Y0PGGLBOmAo51242S5eCSYg6Mz lixfc+EerSym/zpPKVhx5bBP9Zakz5LF3/DEFNiSjjnnLlxWO1St+eGIC6BrxxEuameCf8H0WK1G+ jAuskWrXifHVMlyrmSsPFY/37e7myrtKxpPhna2VzVnTGlMvq+KKtm50+aaYTF8v1G0+aDZfKTr6u sg7Wppfe1MhkfX+APm4fTUaVUbReO80ghpbsfq8HmC1a4zyC2nDAJkfEOy4xugEPZMK9Aq4KYY9at 5YKPhfl8XnxF1ZxXxdo7lYJdOgT9OwJRmR44F2cSpUdhcYx+xOWwtxVcNku2Y6L0cyl2U3QjWXYz1 u4daxbcQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdzcn-0002XB-UL; Wed, 27 May 2020 17:13:53 +0000 Date: Wed, 27 May 2020 10:13:53 -0700 From: Matthew Wilcox To: hui yang Cc: akpm@linux-foundation.org, linux-mm@kvack.org Subject: Re: [PATCH 26/26] mm page_fault: Reduce code complexity Message-ID: <20200527171353.GM17206@bombadil.infradead.org> References: <1590575610-4546-1-git-send-email-yanghui.def@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1590575610-4546-1-git-send-email-yanghui.def@gmail.com> X-Rspamd-Queue-Id: 5FAF710059EA7 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.081521, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 27, 2020 at 06:33:30PM +0800, hui yang wrote: > if pte_alloc_one fail alloc a page, do_fault_around will return 0. > and in do_read_fault()->__do_fault(), it also pte_alloc_one a page. > if pte_alloc_one failed to alloc a page,it will return VM_FAULT_OOM. > To reduce code complexity,if alloc failed we return VM_FAULT_OOM. This doesn't reduce code complexity at all. You've made this error different from every other error handled by this function because now it returns directly instead of jumping to 'out:'. I can't understand your explanation, and at first glance I'm not even sure this patch is correct. Definitely not a simplification, so NAK with this justification. The patch might be correct, but it'll need a lot better prose than this.