mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, Aaron Lu <aaron.lu@intel.com>
Subject: Re: [RFC PATCH] sched: Fix performance regression introduced by mm_cid
Date: Tue, 4 Apr 2023 09:23:15 -0400	[thread overview]
Message-ID: <dfab31c3-a2cf-d52c-966d-0a3bb14b4fdc@efficios.com> (raw)
In-Reply-To: <20230404091005.GA285330@hirez.programming.kicks-ass.net>

On 2023-04-04 05:10, Peter Zijlstra wrote:
> On Tue, Apr 04, 2023 at 10:57:49AM +0200, Peter Zijlstra wrote:
>>
>> Sorry for being a little late to the party.
>>
>> On Mon, Apr 03, 2023 at 02:13:42PM -0400, Mathieu Desnoyers wrote:
>>
>>> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
>>> index 0722859c3647..21466fdc4dc6 100644
>>> --- a/include/linux/mm_types.h
>>> +++ b/include/linux/mm_types.h
>>> @@ -609,6 +609,14 @@ struct mm_struct {
>>>   		 * were being concurrently updated by the updaters.
>>>   		 */
>>>   		raw_spinlock_t cid_lock;
>>> +		/**
>>> +		 * @pcpu_cid: Per-cpu current cid.
>>> +		 *
>>> +		 * Keep track of the currently allocated mm_cid for each cpu.
>>> +		 * The per-cpu mm_cid values are serialized by their respective
>>> +		 * runqueue locks.
>>> +		 */
>>> +		int __percpu *pcpu_cid;
>>
>> This *might* be a problem... Consider running *many* single threaded
>> processes, this could exhaust the limited per-cpu storage (32bit) or use
>> excessive memory on large CPU systems.
>>
>> Consider having to allocate per-cpu storage on a 4K CPU system while
>> only running single threaded processes -- but *LOTS* of them..
> 
> Ah, mm_struct::rss_stat[] beat us and set precedent, so not our problem I
> suppose :-)

Yes, exactly. When I've seen that mm_struct::rss_stat[] did not care 
about having per-mm/per-cpu data, I went the same way.

Thanks,

Mathieu


-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com


  reply	other threads:[~2023-04-04 13:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 18:13 Mathieu Desnoyers
2023-04-04  0:13 ` Mathieu Desnoyers
2023-04-04  1:59   ` Aaron Lu
2023-04-04  8:57 ` Peter Zijlstra
2023-04-04  9:10   ` Peter Zijlstra
2023-04-04 13:23     ` Mathieu Desnoyers [this message]
2023-04-04  9:05 ` Peter Zijlstra
2023-04-04 13:24   ` Mathieu Desnoyers
2023-04-04  9:21 ` Peter Zijlstra

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=dfab31c3-a2cf-d52c-966d-0a3bb14b4fdc@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=aaron.lu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®