public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman•id.au>
To: Mahesh Jagannath Salgaonkar <mahesh@linux•ibm.com>,
	Ganesh <ganeshgr@linux•ibm.com>,
	linuxppc-dev@lists•ozlabs.org
Cc: npiggin@gmail•com
Subject: Re: [PATCH] powerpc/mce: Remove per cpu variables from MCE handlers
Date: Wed, 09 Dec 2020 16:09:32 +1100	[thread overview]
Message-ID: <87pn3jsgz7.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <83ca2e1c-88f5-fc57-11e2-056f3ce835d7@linux.ibm.com>

Mahesh Jagannath Salgaonkar <mahesh@linux•ibm.com> writes:
> On 12/8/20 4:16 PM, Ganesh wrote:
>> 
>> On 12/8/20 4:01 PM, Michael Ellerman wrote:
>>> Ganesh Goudar <ganeshgr@linux•ibm.com> writes:
>>>> diff --git a/arch/powerpc/include/asm/paca.h
>>>> b/arch/powerpc/include/asm/paca.h
>>>> index 9454d29ff4b4..4769954efa7d 100644
>>>> --- a/arch/powerpc/include/asm/paca.h
>>>> +++ b/arch/powerpc/include/asm/paca.h
>>>> @@ -273,6 +274,17 @@ struct paca_struct {
>>>>   #ifdef CONFIG_MMIOWB
>>>>       struct mmiowb_state mmiowb_state;
>>>>   #endif
>>>> +#ifdef CONFIG_PPC_BOOK3S_64
>>>> +    int mce_nest_count;
>>>> +    struct machine_check_event mce_event[MAX_MC_EVT];
>>>> +    /* Queue for delayed MCE events. */
>>>> +    int mce_queue_count;
>>>> +    struct machine_check_event mce_event_queue[MAX_MC_EVT];
>>>> +
>>>> +    /* Queue for delayed MCE UE events. */
>>>> +    int mce_ue_count;
>>>> +    struct machine_check_event  mce_ue_event_queue[MAX_MC_EVT];
>>>> +#endif /* CONFIG_PPC_BOOK3S_64 */
>>>>   } ____cacheline_aligned;
>>> How much does this expand the paca by?
>> 
>> Size of paca is 4480 bytes, these add up another 2160 bytes, so expands
>> it by 48%.
>
> Should we dynamically allocate the array sizes early as similar to that
> of paca->mce_faulty_slbs so that we don't bump up paca size ?

Yeah I think that would be preferable.

That way those allocations can be normal node-local allocations on bare
metal, or when using radix. (Or even on KVM).

In fact what we probably want is a separate struct for all the MCE
related data, eg something like:

struct mce_stuff {
  int nest_count;
  /* Queue for delayed MCE events. */
  int queue_count;
  /* Queue for delayed MCE UE events. */
  int mce_ue_count;

  struct machine_check_event events[MAX_MC_EVT];
  struct machine_check_event event_queue[MAX_MC_EVT];
  struct machine_check_event  ue_event_queue[MAX_MC_EVT];
};

And then you allocate one of those per CPU, inside the RMO for pseries
with hash, and node-local otherwise.

cheers

      reply	other threads:[~2020-12-09  5:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 10:23 [PATCH] powerpc/mce: Remove per cpu variables from MCE handlers Ganesh Goudar
2020-12-08 10:31 ` Michael Ellerman
2020-12-08 10:46   ` Ganesh
2020-12-08 12:04     ` Mahesh Jagannath Salgaonkar
2020-12-09  5:09       ` Michael Ellerman [this message]

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=87pn3jsgz7.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman$(echo .)id.au \
    --cc=ganeshgr@linux$(echo .)ibm.com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mahesh@linux$(echo .)ibm.com \
    --cc=npiggin@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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