All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jordan <daniel.m.jordan@oracle.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Daniel Jordan <daniel.m.jordan@oracle.com>,
	akpm@linux-foundation.org, Alan Tull <atull@kernel.org>,
	Alex Williamson <alex.williamson@redhat.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Christoph Lameter <cl@linux.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Moritz Fischer <mdf@kernel.org>,
	Paul Mackerras <paulus@ozlabs.org>, Wu Hao <hao.wu@intel.com>,
	linux-mm@kvack.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-fpga@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] mm: change locked_vm's type from unsigned long to atomic64_t
Date: Thu, 11 Apr 2019 16:28:07 -0400	[thread overview]
Message-ID: <20190411202807.q2fge33uoduhtehq@ca-dmjordan1.us.oracle.com> (raw)
In-Reply-To: <20190411095543.GA55197@lakrids.cambridge.arm.com>

On Thu, Apr 11, 2019 at 10:55:43AM +0100, Mark Rutland wrote:
> On Thu, Apr 11, 2019 at 02:22:23PM +1000, Alexey Kardashevskiy wrote:
> > On 03/04/2019 07:41, Daniel Jordan wrote:
> 
> > > -	dev_dbg(dev, "[%d] RLIMIT_MEMLOCK %c%ld %ld/%ld%s\n", current->pid,
> > > +	dev_dbg(dev, "[%d] RLIMIT_MEMLOCK %c%ld %lld/%lu%s\n", current->pid,
> > >  		incr ? '+' : '-', npages << PAGE_SHIFT,
> > > -		current->mm->locked_vm << PAGE_SHIFT, rlimit(RLIMIT_MEMLOCK),
> > > -		ret ? "- exceeded" : "");
> > > +		(s64)atomic64_read(&current->mm->locked_vm) << PAGE_SHIFT,
> > > +		rlimit(RLIMIT_MEMLOCK), ret ? "- exceeded" : "");
> > 
> > 
> > 
> > atomic64_read() returns "long" which matches "%ld", why this change (and
> > similar below)? You did not do this in the two pr_debug()s above anyway.
> 
> Unfortunately, architectures return inconsistent types for atomic64 ops.
> 
> Some return long (e..g. powerpc), some return long long (e.g. arc), and
> some return s64 (e.g. x86).

Yes, Mark said it all, I'm just chiming in to confirm that's why I added the
cast.

Btw, thanks for doing this, Mark.

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Jordan <daniel.m.jordan@oracle.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	kvm@vger.kernel.org, Alan Tull <atull@kernel.org>,
	Alexey Kardashevskiy <aik@ozlabs.ru>,
	linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm-ppc@vger.kernel.org,
	Daniel Jordan <daniel.m.jordan@oracle.com>,
	linux-mm@kvack.org, Alex Williamson <alex.williamson@redhat.com>,
	Moritz Fischer <mdf@kernel.org>,
	akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org,
	Christoph Lameter <cl@linux.com>, Wu Hao <hao.wu@intel.com>
Subject: Re: [PATCH 1/6] mm: change locked_vm's type from unsigned long to atomic64_t
Date: Thu, 11 Apr 2019 16:28:07 -0400	[thread overview]
Message-ID: <20190411202807.q2fge33uoduhtehq@ca-dmjordan1.us.oracle.com> (raw)
In-Reply-To: <20190411095543.GA55197@lakrids.cambridge.arm.com>

On Thu, Apr 11, 2019 at 10:55:43AM +0100, Mark Rutland wrote:
> On Thu, Apr 11, 2019 at 02:22:23PM +1000, Alexey Kardashevskiy wrote:
> > On 03/04/2019 07:41, Daniel Jordan wrote:
> 
> > > -	dev_dbg(dev, "[%d] RLIMIT_MEMLOCK %c%ld %ld/%ld%s\n", current->pid,
> > > +	dev_dbg(dev, "[%d] RLIMIT_MEMLOCK %c%ld %lld/%lu%s\n", current->pid,
> > >  		incr ? '+' : '-', npages << PAGE_SHIFT,
> > > -		current->mm->locked_vm << PAGE_SHIFT, rlimit(RLIMIT_MEMLOCK),
> > > -		ret ? "- exceeded" : "");
> > > +		(s64)atomic64_read(&current->mm->locked_vm) << PAGE_SHIFT,
> > > +		rlimit(RLIMIT_MEMLOCK), ret ? "- exceeded" : "");
> > 
> > 
> > 
> > atomic64_read() returns "long" which matches "%ld", why this change (and
> > similar below)? You did not do this in the two pr_debug()s above anyway.
> 
> Unfortunately, architectures return inconsistent types for atomic64 ops.
> 
> Some return long (e..g. powerpc), some return long long (e.g. arc), and
> some return s64 (e.g. x86).

Yes, Mark said it all, I'm just chiming in to confirm that's why I added the
cast.

Btw, thanks for doing this, Mark.

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Jordan <daniel.m.jordan@oracle.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Daniel Jordan <daniel.m.jordan@oracle.com>,
	akpm@linux-foundation.org, Alan Tull <atull@kernel.org>,
	Alex Williamson <alex.williamson@redhat.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Christoph Lameter <cl@linux.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Moritz Fischer <mdf@kernel.org>,
	Paul Mackerras <paulus@ozlabs.org>, Wu Hao <hao.wu@intel.com>,
	linux-mm@kvack.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-fpga@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] mm: change locked_vm's type from unsigned long to atomic64_t
Date: Thu, 11 Apr 2019 20:28:07 +0000	[thread overview]
Message-ID: <20190411202807.q2fge33uoduhtehq@ca-dmjordan1.us.oracle.com> (raw)
In-Reply-To: <20190411095543.GA55197@lakrids.cambridge.arm.com>

On Thu, Apr 11, 2019 at 10:55:43AM +0100, Mark Rutland wrote:
> On Thu, Apr 11, 2019 at 02:22:23PM +1000, Alexey Kardashevskiy wrote:
> > On 03/04/2019 07:41, Daniel Jordan wrote:
> 
> > > -	dev_dbg(dev, "[%d] RLIMIT_MEMLOCK %c%ld %ld/%ld%s\n", current->pid,
> > > +	dev_dbg(dev, "[%d] RLIMIT_MEMLOCK %c%ld %lld/%lu%s\n", current->pid,
> > >  		incr ? '+' : '-', npages << PAGE_SHIFT,
> > > -		current->mm->locked_vm << PAGE_SHIFT, rlimit(RLIMIT_MEMLOCK),
> > > -		ret ? "- exceeded" : "");
> > > +		(s64)atomic64_read(&current->mm->locked_vm) << PAGE_SHIFT,
> > > +		rlimit(RLIMIT_MEMLOCK), ret ? "- exceeded" : "");
> > 
> > 
> > 
> > atomic64_read() returns "long" which matches "%ld", why this change (and
> > similar below)? You did not do this in the two pr_debug()s above anyway.
> 
> Unfortunately, architectures return inconsistent types for atomic64 ops.
> 
> Some return long (e..g. powerpc), some return long long (e.g. arc), and
> some return s64 (e.g. x86).

Yes, Mark said it all, I'm just chiming in to confirm that's why I added the
cast.

Btw, thanks for doing this, Mark.

  reply	other threads:[~2019-04-11 20:28 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 20:41 [PATCH 0/6] convert locked_vm from unsigned long to atomic64_t Daniel Jordan
2019-04-02 20:41 ` Daniel Jordan
2019-04-02 20:41 ` Daniel Jordan
2019-04-02 20:41 ` Daniel Jordan
2019-04-02 20:41 ` [PATCH 1/6] mm: change locked_vm's type " Daniel Jordan
2019-04-02 20:41   ` Daniel Jordan
2019-04-02 20:41   ` Daniel Jordan
2019-04-02 22:04   ` Andrew Morton
2019-04-02 22:04     ` Andrew Morton
2019-04-02 22:04     ` Andrew Morton
2019-04-02 23:43     ` Davidlohr Bueso
2019-04-02 23:43       ` Davidlohr Bueso
2019-04-02 23:43       ` Davidlohr Bueso
2019-04-03 16:07       ` Daniel Jordan
2019-04-03 16:07         ` Daniel Jordan
2019-04-03 15:58     ` Daniel Jordan
2019-04-03 15:58       ` Daniel Jordan
2019-04-03 15:58       ` Daniel Jordan
2019-04-03  4:46   ` Christophe Leroy
2019-04-03  4:46     ` Christophe Leroy
2019-04-03 16:09     ` Daniel Jordan
2019-04-03 16:09       ` Daniel Jordan
2019-04-03 16:09       ` Daniel Jordan
2019-04-03 16:09       ` Daniel Jordan
2019-04-11  4:22   ` Alexey Kardashevskiy
2019-04-11  4:22     ` Alexey Kardashevskiy
2019-04-11  4:22     ` Alexey Kardashevskiy
2019-04-11  9:55     ` Mark Rutland
2019-04-11  9:55       ` Mark Rutland
2019-04-11  9:55       ` Mark Rutland
2019-04-11 20:28       ` Daniel Jordan [this message]
2019-04-11 20:28         ` Daniel Jordan
2019-04-11 20:28         ` Daniel Jordan
2019-04-16 23:33         ` Andrew Morton
2019-04-16 23:33           ` Andrew Morton
2019-04-16 23:33           ` Andrew Morton
2019-04-22 15:54           ` Daniel Jordan
2019-04-22 15:54             ` Daniel Jordan
2019-04-22 15:54             ` Daniel Jordan
2019-04-02 20:41 ` [PATCH 2/6] vfio/type1: drop mmap_sem now that locked_vm is atomic Daniel Jordan
2019-04-02 20:41 ` [PATCH 3/6] vfio/spapr_tce: " Daniel Jordan
2019-04-02 20:41 ` [PATCH 4/6] fpga/dlf/afu: " Daniel Jordan
2019-04-02 20:41 ` [PATCH 5/6] powerpc/mmu: " Daniel Jordan
2019-04-02 20:41   ` Daniel Jordan
2019-04-03  4:58   ` Christophe Leroy
2019-04-03 16:40     ` Daniel Jordan
2019-04-03 16:40       ` Daniel Jordan
2019-04-24  2:15       ` Davidlohr Bueso
2019-04-24  2:15         ` Davidlohr Bueso
2019-04-24  2:31         ` Davidlohr Bueso
2019-04-24 11:10         ` Jason Gunthorpe
2019-04-24 11:10           ` Jason Gunthorpe
2019-04-25  1:47           ` Daniel Jordan
2019-04-25  1:47             ` Daniel Jordan
2019-04-02 20:41 ` [PATCH 6/6] kvm/book3s: " Daniel Jordan
2019-04-02 20:41   ` Daniel Jordan
2019-04-02 20:41   ` Daniel Jordan
2019-04-03 12:51 ` [PATCH 0/6] convert locked_vm from unsigned long to atomic64_t Steven Sistare
2019-04-03 12:51   ` Steven Sistare
2019-04-03 12:51   ` Steven Sistare
2019-04-03 16:52   ` Daniel Jordan
2019-04-03 16:52     ` Daniel Jordan
2019-04-03 16:52     ` Daniel Jordan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190411202807.q2fge33uoduhtehq@ca-dmjordan1.us.oracle.com \
    --to=daniel.m.jordan@oracle.com \
    --cc=aik@ozlabs.ru \
    --cc=akpm@linux-foundation.org \
    --cc=alex.williamson@redhat.com \
    --cc=atull@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=cl@linux.com \
    --cc=dave@stgolabs.net \
    --cc=hao.wu@intel.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=mdf@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.