Received: by 10.223.185.116 with SMTP id b49csp7389539wrg; Thu, 1 Mar 2018 04:54:52 -0800 (PST) X-Google-Smtp-Source: AG47ELvqBZgQYtZM6RqForY9NuLRCNNfZ0LD2huS6/0solNHd27tF6Tql3mc7QYGa/bNHi8UCiBZ X-Received: by 10.98.192.203 with SMTP id g72mr1867817pfk.27.1519908892639; Thu, 01 Mar 2018 04:54:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519908892; cv=none; d=google.com; s=arc-20160816; b=IFc/wD3Xasf9vf7u/i06Jiwepr0DRhABiO1oL3/DQi+54sENSPQam8+DN50FCvWLtD csSJuyUu24N0FpTuH4Bd7VvhF+vJKPbA8X3Eeo/QK/2/n9qoVfcWFOYku728rz1D0cIB 06Dy/wejRv2gpfkU5qZrhy2eRRV07DDIZBp4N/RLz8OGxxLj46rmbsooE1imT2ASpMCU ksP/5jk1OgWI1zBBmea6ROCNlglKlLgUf5XarekMRa5wRmoozlCe18Q2knGe9kNp127f mKicq33N49nmwsmDLsLat/k98i1jzbhkTEvZcoLcxf7ijgwIwBCbWCBZO1Db//JhAcL1 5Dkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=0O06UqWYDymMT9VDce6rP709Z0pu6xPVjA+vaPOIXlg=; b=jL8EOFG03wKV8bbcWEjIffVh5sSlGsU6MZsydj+BvOWgCvPP11EwbNvDyaQ3gl4gLx jwHFnYhAxvJTsRBIOMnBl1WaT/OGlPh1leSrySOPI3Io5iWfR68iOP342Gfxcfg7h4pv /vPeSgy4wBT4v3xJmmajiZ7Gyh2DFE4IEPPOTBK1qquLy7Cjx1mRhtbTDcopCWfsTc0b 8FW08xae/v29fA8aHVxrttnN8ictat/SSXyG+9iCWyDd5gxeuOV5MJ0bhvlb77E+Y5lD k4L5c6jYPjBEC86Vbk/HRG0GwNahlZzo4/Dw2w/JKmvBZuEWit4albtjo7uprsQX+FEf +hoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=T/+CdoLo; 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 v5-v6si3060466plp.156.2018.03.01.04.54.38; Thu, 01 Mar 2018 04:54:52 -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; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=T/+CdoLo; 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 S1030592AbeCAMxZ (ORCPT + 99 others); Thu, 1 Mar 2018 07:53:25 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:35392 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030504AbeCAMxX (ORCPT ); Thu, 1 Mar 2018 07:53:23 -0500 Received: by mail-wm0-f53.google.com with SMTP id x7so11426970wmc.0 for ; Thu, 01 Mar 2018 04:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0O06UqWYDymMT9VDce6rP709Z0pu6xPVjA+vaPOIXlg=; b=T/+CdoLowu95/zNTQmSINZwUbx40OVU2IecJov8FSfQGlZ5wNOj8ML8vd8BsKYSu7o AQ3TGO0jU9r2Zt/x8AvgT73rwwu/HMC3nRbFwzZKQ/nrdMbFJK0zVb54m9e6pOtGDmHs EzUlh0wmWQACO26idutvLqXzPuxvzOs7d11LLB3mqBmPN5ZMQpoc4ZTYFLMPvY8ZuMGr CpVULbeppAI7MGtv9bNA/YPdjCqHukluzzT88mHRlOVfQID/nDp5jBZg3D93sHOU6hAw XmVPLAuDqrIqCmLd6hjiPVk8N1422WZ2+sCXir0tmth6CTAd3K8bIGD7ydsmNmU7qGI9 67hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0O06UqWYDymMT9VDce6rP709Z0pu6xPVjA+vaPOIXlg=; b=LDnEmH0SywADrPRQLVhP5uT9IP2BsAWphXEi5RE/3RvbdC1Q57akIkjeq1SvYGluC2 WgbI88EEM+5SYWIMjJWao2FxQ4qQwWe03NulQ+9yZK89LMOMZgaS0PK4iz7fxsVDK0Yl MCNTce1bMWtY5nzHF0eLRyZOw+vC13ST/dMG1Wv5e71yQtSw3twoP99Y6E4fXrQb6AhQ W6d67f9TyZ/u507o0/iywberJED1HIvpRf+ukGRwAvOV0ElHzcUbRaZUzXO61TWFFEuF MkNUjaprQEIkBMgYjnRgrbC3t+++Cgtgi9bYKWKGAB/g1JfyIOrgmiQBtc7xVB4dFZmk KPBg== X-Gm-Message-State: APf1xPARROh698nfonlzptRDK36X7AAlktLv4qgSWiJ+9lzHnaZ3h3V+ XZAh5igShrfCjyRM4KwdhkmVpg== X-Received: by 10.80.139.230 with SMTP id n35mr2704878edn.149.1519908802423; Thu, 01 Mar 2018 04:53:22 -0800 (PST) Received: from node.shutemov.name ([178.121.199.127]) by smtp.gmail.com with ESMTPSA id v15sm4864486edl.12.2018.03.01.04.53.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 04:53:21 -0800 (PST) Received: by node.shutemov.name (Postfix, from userid 1000) id E344E648D520; Thu, 1 Mar 2018 15:53:10 +0300 (+03) Date: Thu, 1 Mar 2018 15:53:10 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox Cc: linux-mm@kvack.org, Matthew Wilcox , Martin Schwidefsky , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/4] s390: Use _refcount for pgtables Message-ID: <20180301125310.jx6c5dypk5axrmum@node.shutemov.name> References: <20180228223157.9281-1-willy@infradead.org> <20180228223157.9281-2-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180228223157.9281-2-willy@infradead.org> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 28, 2018 at 02:31:54PM -0800, Matthew Wilcox wrote: > From: Matthew Wilcox > > s390 borrows the storage used for _mapcount in struct page in order to > account whether the bottom or top half is being used for 2kB page > tables. I want to use that for something else, so use the top byte of > _refcount instead of the bottom byte of _mapcount. _refcount may > temporarily be incremented by other CPUs that see a stale pointer to > this page in the page cache, but each CPU can only increment it by one, > and there are no systems with 2^24 CPUs today, so they will not change > the upper byte of _refcount. We do have to be a little careful not to > lose any of their writes (as they will subsequently decrement the > counter). Hm. I'm more worried about false-negative put_page_testzero(). Are you sure it won't lead to leaks. I cannot say from the code changes. And for page-table pages should have planty space in other fields. IIRC page->mapping is unused there. -- Kirill A. Shutemov