From patchwork Sun Nov 4 12:44:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10666857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F14E109C for ; Sun, 4 Nov 2018 12:45:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3151A299FE for ; Sun, 4 Nov 2018 12:45:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2499229A03; Sun, 4 Nov 2018 12:45:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80E4F299FE for ; Sun, 4 Nov 2018 12:45:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 01EE56B0003; Sun, 4 Nov 2018 07:45:19 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F0E506B0005; Sun, 4 Nov 2018 07:45:18 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFE4F6B0007; Sun, 4 Nov 2018 07:45:18 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by kanga.kvack.org (Postfix) with ESMTP id A125D6B0003 for ; Sun, 4 Nov 2018 07:45:18 -0500 (EST) Received: by mail-pf1-f198.google.com with SMTP id t22-v6so6265833pfi.13 for ; Sun, 04 Nov 2018 04:45:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=bIm8zLb4s7u1F5PBDoMxVkZnvfUC6HnYnH6nJeMIfT8=; b=sMWVz6U78tqAbWtOutK93Z5SkaCRpaNVeumj1riBGdmU1ua5fEgZr5ImdCBL56oIcr uqDzzFzRDcAPv2AeYcWw9LAadr9VhKpjo2DkjUE/IhYi3zGBBrg2XwfLVtn0i/bdudyv m+vEGEmlVBB6a7IrGCOcIQGgCcr1WzQdOfk5/4lDJjC0lRhHjt8MFfKafvH2UbkUZp4S e1kSx6kPf6HyLVQkfwReFkz2/FXqQKAti9SbZ1aXuOLOhFOXTaquxy835SbMRne7rJkl kzeA8So3m+cx/uhuyUCwz22zf26DPWkKdf7a/aCgJgx0Ay8Bgi+QCrN73YilYkzKDQvW rdoA== X-Gm-Message-State: AGRZ1gKV0mYUzyA7m4eFkCcjrXxUGxMdlDsNPFk6VIqfqh4rLGb/UNFe 1RhZ+40aKUCn68FZt+E7sq7ZoxuDefhSfvg3KUTfhKQ4Hw+6Ld/C+N803RdcYYEtVxmZgTM/KWZ 4xyiXcqYRDh/HsScJWFvVC4GUt2rKh9bAYa9siN8lk1vM1k78pK9niRMAm93postkHl03aoX/QX qpdOYEKFcyqGppXDUtjQoVuCm+v7gKb1q39IwDPjItEtzRghLdWg8pKlHiom4ByVxQK+MTrkAKY R/a0ftLfLItPy7dhmN/TBz9GvPfaNwdciS9Af1sJK/aVC9XcXDTNsEjxGpwY/wyB8e5+Lto0JMo dA1EjBW/RZIjGyF/n7s1VUM5fflGv+1lYS7Pb3XXFIahoWs9exuTVh9hbHBUsrYp62zqUDCXPEz 2 X-Received: by 2002:a63:9f0a:: with SMTP id g10-v6mr15959639pge.232.1541335518097; Sun, 04 Nov 2018 04:45:18 -0800 (PST) X-Received: by 2002:a63:9f0a:: with SMTP id g10-v6mr15959609pge.232.1541335517371; Sun, 04 Nov 2018 04:45:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541335517; cv=none; d=google.com; s=arc-20160816; b=PZ6yyQAucmXDQJFeDfZsJvZDxKurjDeq5M/g61Fy+UzvgyHTh6uC4qkEWoaiF6UVYN +zt2wJG/ZG88YLHp6Ur3XLGSRXnbiYvQU7Vo54B5aBvruvf+HI7V/yoiOSlDYrUFgKQ5 wXZpdheEY2s1BUyx7uhjCMc7NbtQu37lOH3AjI5FR5LquNciaY2R2ZiDPzj+2jzHFixx HR9g0kukrVV5xFEPDD5YfRG9UX/vSwCzW1h4K66LrsS9/EOKK1yF66u3qxZimj2vDrZM sMjL92j1FjUWl1208FmHfr9J22kxWv3pJnZ0TIvbxigIpCgwaGW7b1mDD+rj+YrPzqz5 O8sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=bIm8zLb4s7u1F5PBDoMxVkZnvfUC6HnYnH6nJeMIfT8=; b=bAQjkTFPC++Sn4mbgsoz8VAmiF32sIEslYj+TvT7ybhkjwrb0VGYdfQIpXbNXbQ1oA oOXVV4sWYYqB8sB/9vIKdPoIoRqoABukAAluCCWSwD0nm2F1rT1fhmNfvUXTmvzrZjDY 1WjR4Io3MLTlgXcSxT9L7J+HTHS5JbX9Y3HjlM+ffITTMrcciN5wANvgT6kULKw51OBe kXELKukXHye6h6bHmpuipmfAFovpzOh+3L0WYw3VcsbclPneDKa4gaOi6rBEGjCBDd/z F7e/L/Jl/jImKK06OHRGE+V4g9XvXhq2Vnm7Jt7XwnBZHTMt8dr2C4vxAZNs0lsjC6AE U/ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NVprx+qL; spf=pass (google.com: domain of tiny.windzz@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=tiny.windzz@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v68-v6sor5298817pfv.20.2018.11.04.04.45.17 for (Google Transport Security); Sun, 04 Nov 2018 04:45:17 -0800 (PST) Received-SPF: pass (google.com: domain of tiny.windzz@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NVprx+qL; spf=pass (google.com: domain of tiny.windzz@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=tiny.windzz@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=bIm8zLb4s7u1F5PBDoMxVkZnvfUC6HnYnH6nJeMIfT8=; b=NVprx+qLLJlRaUTyXdzvHY6+plxXZ01KXfBOuPV+cXeTwiOTb/4js6gNPyOpAtO3Rd cPv2dolDGSwTKnu/i0L/SpH19cu0b5DMZ9aK0IDFFpOSzwjgzfLw2UZCpCX69bfRKNDr WrtEVM7siWvv7UmtgX/CRgeRNp+K9PL//FyuKLxQYKXkm5IJhx9P1K3s/CSwzSATUjT8 TJyoChm7HB/npNdhLNrRFg3OGbZ+hrRYHurRIA87qrZvxf+bBEFDWxIhuN/Svu3Alg17 6upt23lb7jh9fUgzmJH7+mhn1B7fhXM+SS4IxtvNsjo/O1gnWplEKHg9Ctf98SaZQcnT v1cg== X-Google-Smtp-Source: AJdET5cz3ORAB57b8YsBFFNY88eubj0WiRR5p3daV4nT/q+oOwns+eHuHzqi5vdhRt0uAgjGMMpcjA== X-Received: by 2002:a62:2ec3:: with SMTP id u186-v6mr18396348pfu.189.1541335516786; Sun, 04 Nov 2018 04:45:16 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id i6-v6sm42047883pfb.135.2018.11.04.04.45.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Nov 2018 04:45:15 -0800 (PST) From: Yangtao Li To: akpm@linux-foundation.org, mhocko@suse.com, kirill.shutemov@linux.intel.com, vbabka@suse.cz, yang.shi@linux.alibaba.com, rientjes@google.com, linux@dominikbrodowski.net Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH] mm: mmap: remove unnecessary unlikely() Date: Sun, 4 Nov 2018 07:44:56 -0500 Message-Id: <20181104124456.3424-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 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: X-Virus-Scanned: ClamAV using ClamSMTP WARN_ON() already contains an unlikely(), so it's not necessary to use unlikely. Signed-off-by: Yangtao Li --- mm/mmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 6c04292e16a7..2077008ade0c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2965,10 +2965,8 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, static inline void verify_mm_writelocked(struct mm_struct *mm) { #ifdef CONFIG_DEBUG_VM - if (unlikely(down_read_trylock(&mm->mmap_sem))) { - WARN_ON(1); + if (WARN_ON(down_read_trylock(&mm->mmap_sem))) up_read(&mm->mmap_sem); - } #endif }