Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1279630imj; Thu, 7 Feb 2019 21:49:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IaNmWXujF4DIA9hE+FLja1rDMBCwOcNDxagIRXygp09chwv/nbblJt3ADUIe84rK6psfoRT X-Received: by 2002:a63:5902:: with SMTP id n2mr8664376pgb.354.1549604981816; Thu, 07 Feb 2019 21:49:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549604981; cv=none; d=google.com; s=arc-20160816; b=WRl/PtRvETdKxACndeaY1cnDweT1Fgu6A6ojgpKq6dGAg17jTzsHVgNxJGwWJHzQas 60lRww+i//U0/4xaRmGneb8MiiRsUKo35vMkRoIJs/czhwDC+qoIxYvvm6SHQh2KmcM4 TGTPddXwehpuhHEui1dS/JS8cvgOg4erEZ6PrrK867V8yYLvrthDxv9Su1fz76KG0/LP RblDkxhPRNoSS+Rfv6jIYORvy34Il+8MNvvR04nSg7iOiMI3lm0fIorJ8gb8NNr2zLgN qiFvO/n3ag7mL7ZRJuvs55gp6lfl5k5MdYIg9dvKd1pQH8q+vF3hTorEUN8/I9FUmHDV vBVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=ks/eFtZMf2z0pCGMP0uadMDNQm+vNSqdslkJnl/9wRk=; b=T8flfMt2I8SdowKmAnG5MwzVnPKReQohR/zFIUyjloBwmGgBrJdqpWiunFzTDaiD7Q 6sLGdEL4AtYHbSOss5clLCzpCWkyRa/f0VHb9tJiddd7/qQTTbhqB2brs/hV2GQdE2wV vjcAwTstHmbMSJnHuv9/7KUOEnfJVs/4vNnoOZJ0PHf2eUBJnuvh1RP2lKyMG6ESmjai y5Pe3jHYhFAw2IhjoDPMsnENRtXqMELF93d3vScbGMWxbngIw58enqwJFnI2md76K6jP lr1HJNtGM4CfyLy2tj5pOWMDeQOK1X5u0rTSKpclmHmetNPp81IFXj6fcvkqOIyu+Ne4 rX4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si1182255pgi.443.2019.02.07.21.49.25; Thu, 07 Feb 2019 21:49:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726351AbfBHFtU (ORCPT + 99 others); Fri, 8 Feb 2019 00:49:20 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44682 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725940AbfBHFtU (ORCPT ); Fri, 8 Feb 2019 00:49:20 -0500 Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E469FBF56; Fri, 8 Feb 2019 05:49:18 +0000 (UTC) Date: Thu, 7 Feb 2019 21:49:17 -0800 From: Andrew Morton To: john.hubbard@gmail.com Cc: Nick Piggin , linux-mm@kvack.org, Benjamin Herrenschmidt , Dave Kleikamp , Hugh Dickins , Jeff Layton , Matthew Wilcox , Vlastimil Babka , LKML , John Hubbard Subject: Re: [PATCH 1/1] mm: page_cache_add_speculative(): refactor out some code duplication Message-Id: <20190207214917.9d07ca3fc52d3df0cde018bd@linux-foundation.org> In-Reply-To: <20190206231016.22734-2-jhubbard@nvidia.com> References: <20190206231016.22734-1-jhubbard@nvidia.com> <20190206231016.22734-2-jhubbard@nvidia.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Feb 2019 15:10:16 -0800 john.hubbard@gmail.com wrote: > From: John Hubbard > > This combines the common elements of these routines: > > page_cache_get_speculative() > page_cache_add_speculative() > > This was anticipated by the original author, as shown by the comment > in commit ce0ad7f095258 ("powerpc/mm: Lockless get_user_pages_fast() > for 64-bit (v3)"): > > "Same as above, but add instead of inc (could just be merged)" > > There is no intention to introduce any behavioral change, but there is a > small risk of that, due to slightly differing ways of expressing the > TINY_RCU and related configurations. > > This also removes the VM_BUG_ON(in_interrupt()) that was in > page_cache_add_speculative(), but not in page_cache_get_speculative(). This > provides slightly less detection of such bugs, but it given that it was > only there on the "add" path anyway, we can likely do without it just fine. It removes the VM_BUG_ON_PAGE(PageCompound(page) && page != compound_head(page), page); also. We'll live ;)