Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-14 Thread Thomas Gleixner
Fenghua, On Tue, Apr 13 2021 at 23:40, Fenghua Yu wrote: > On Mon, Apr 12, 2021 at 09:15:08AM +0200, Thomas Gleixner wrote: >> Aside of that why are you trying to make this throttling in any way >> accurate? It does not matter at all, really. Limit reached, put it to >> sleep for some time and be

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-13 Thread Fenghua Yu
Hi, Thomas, On Mon, Apr 12, 2021 at 09:15:08AM +0200, Thomas Gleixner wrote: > On Sat, Apr 03 2021 at 01:04, Fenghua Yu wrote: > > On Sat, Mar 20, 2021 at 01:42:52PM +0100, Thomas Gleixner wrote: > >> On Fri, Mar 19 2021 at 22:19, Fenghua Yu wrote: > >> And even with throttling the injection rate

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-12 Thread Thomas Gleixner
On Sat, Apr 03 2021 at 01:04, Fenghua Yu wrote: > On Sat, Mar 20, 2021 at 01:42:52PM +0100, Thomas Gleixner wrote: >> On Fri, Mar 19 2021 at 22:19, Fenghua Yu wrote: >> And even with throttling the injection rate further down to 25k per >> second the impact on the workload is still significant in

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-02 Thread Fenghua Yu
Hi, Thomas, On Sat, Mar 20, 2021 at 01:42:52PM +0100, Thomas Gleixner wrote: > On Fri, Mar 19 2021 at 22:19, Fenghua Yu wrote: > > On Fri, Mar 19, 2021 at 10:30:50PM +0100, Thomas Gleixner wrote: > >> > +if (sscanf(arg, "ratelimit:%d", ) == 1 && ratelimit > > >> > 0) { > >> > +

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-02 Thread Fenghua Yu
Hi, Thomas, On Sat, Mar 20, 2021 at 02:57:52PM +0100, Thomas Gleixner wrote: > On Sat, Mar 20 2021 at 02:01, Thomas Gleixner wrote: > > > On Fri, Mar 19 2021 at 21:50, Tony Luck wrote: > >>> What is the justifucation for making this rate limit per UID and not > >>> per task, per process or

RE: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-20 Thread Thomas Gleixner
On Sat, Mar 20 2021 at 02:01, Thomas Gleixner wrote: > On Fri, Mar 19 2021 at 21:50, Tony Luck wrote: >>> What is the justifucation for making this rate limit per UID and not >>> per task, per process or systemwide? >> >> The concern is that a malicious user is running a workload that loops >>

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-20 Thread Thomas Gleixner
On Fri, Mar 19 2021 at 22:19, Fenghua Yu wrote: > On Fri, Mar 19, 2021 at 10:30:50PM +0100, Thomas Gleixner wrote: >> > + if (sscanf(arg, "ratelimit:%d", ) == 1 && ratelimit > 0) { >> > + bld_ratelimit = ratelimit; >> >> So any rate up to INTMAX/s is valid here, right? > > Yes. I don't

RE: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-19 Thread Thomas Gleixner
On Fri, Mar 19 2021 at 21:50, Tony Luck wrote: >> What is the justifucation for making this rate limit per UID and not >> per task, per process or systemwide? > > The concern is that a malicious user is running a workload that loops > obtaining the buslock. This brings the whole system to its

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-19 Thread Fenghua Yu
Hi, Thomas, On Fri, Mar 19, 2021 at 10:30:50PM +0100, Thomas Gleixner wrote: > On Sat, Mar 13 2021 at 05:49, Fenghua Yu wrote: > > Change Log: > > v5: > > Address all comments from Thomas: > > - Merge patch 2 and patch 3 into one patch so all "split_lock_detect=" > > options are processed in

RE: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-19 Thread Luck, Tony
> What is the justifucation for making this rate limit per UID and not > per task, per process or systemwide? The concern is that a malicious user is running a workload that loops obtaining the buslock. This brings the whole system to its knees. Limiting per task doesn't help. The user can

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-19 Thread Thomas Gleixner
On Sat, Mar 13 2021 at 05:49, Fenghua Yu wrote: > Change Log: > v5: > Address all comments from Thomas: > - Merge patch 2 and patch 3 into one patch so all "split_lock_detect=" > options are processed in one patch. What? I certainly did not request that. I said: "Why is this seperate and an

[PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-12 Thread Fenghua Yu
Bus locks degrade performance for the whole system, not just for the CPU that requested the bus lock. Two CPU features "#AC for split lock" and "#DB for bus lock" provide hooks so that the operating system may choose one of several mitigation strategies. #AC for split lock is already implemented.