* [PATCH][next] i2c: slave-eeprom: Use fallthrough pseudo-keyword
From: Gustavo A. R. Silva @ 2020-07-16 21:59 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
drivers/i2c/i2c-slave-eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/i2c-slave-eeprom.c b/drivers/i2c/i2c-slave-eeprom.c
index 593f2fd39d17..5c7ae421cacf 100644
--- a/drivers/i2c/i2c-slave-eeprom.c
+++ b/drivers/i2c/i2c-slave-eeprom.c
@@ -66,7 +66,7 @@ static int i2c_slave_eeprom_slave_cb(struct i2c_client *client,
case I2C_SLAVE_READ_PROCESSED:
/* The previous byte made it to the bus, get next one */
eeprom->buffer_idx++;
- /* fallthrough */
+ fallthrough;
case I2C_SLAVE_READ_REQUESTED:
spin_lock(&eeprom->buffer_lock);
*val = eeprom->buffer[eeprom->buffer_idx & eeprom->address_mask];
--
2.27.0
^ permalink raw reply related
* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v6,01/11] HAX to make DSC work on the icelake test system (rev2)
From: Patchwork @ 2020-07-16 21:54 UTC (permalink / raw)
To: Manasi Navare; +Cc: intel-gfx
In-Reply-To: <20200715224222.7557-1-manasi.d.navare@intel.com>
== Series Details ==
Series: series starting with [v6,01/11] HAX to make DSC work on the icelake test system (rev2)
URL : https://patchwork.freedesktop.org/series/79534/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.0
Fast mode used, each commit won't be checked separately.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [v6,01/11] HAX to make DSC work on the icelake test system (rev2)
From: Patchwork @ 2020-07-16 21:53 UTC (permalink / raw)
To: Manasi Navare; +Cc: intel-gfx
In-Reply-To: <20200715224222.7557-1-manasi.d.navare@intel.com>
== Series Details ==
Series: series starting with [v6,01/11] HAX to make DSC work on the icelake test system (rev2)
URL : https://patchwork.freedesktop.org/series/79534/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
6756ad0df458 HAX to make DSC work on the icelake test system
42b7ec254efd drm/i915: Remove hw.mode
fb6b540c3882 drm/i915: Add hw.pipe_mode to allow bigjoiner pipe/transcoder split
-:216: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided
#216: FILE: drivers/gpu/drm/i915/display/intel_display.c:13219:
+ crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode;
total: 0 errors, 0 warnings, 1 checks, 445 lines checked
e1afb809eac2 drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
07b3d174ba99 drm/i915: Try to make bigjoiner work in atomic check
-:143: WARNING:LONG_LINE: line length of 101 exceeds 100 columns
#143: FILE: drivers/gpu/drm/i915/display/intel_display.c:13232:
+ crtc_state->bigjoiner_linked_crtc);
-:202: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided
#202: FILE: drivers/gpu/drm/i915/display/intel_display.c:13303:
+ crtc_state->nv12_planes = crtc_state->c8_planes = crtc_state->update_planes = 0;
-:296: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided
#296: FILE: drivers/gpu/drm/i915/display/intel_display.c:14920:
+ slave = new_crtc_state->bigjoiner_linked_crtc =
-:330: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided
#330: FILE: drivers/gpu/drm/i915/display/intel_display.c:14954:
+ slave_crtc_state->bigjoiner = master_crtc_state->bigjoiner = false;
-:331: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided
#331: FILE: drivers/gpu/drm/i915/display/intel_display.c:14955:
+ slave_crtc_state->bigjoiner_slave = master_crtc_state->bigjoiner_slave = false;
-:332: WARNING:LONG_LINE: line length of 106 exceeds 100 columns
#332: FILE: drivers/gpu/drm/i915/display/intel_display.c:14956:
+ slave_crtc_state->bigjoiner_linked_crtc = master_crtc_state->bigjoiner_linked_crtc = NULL;
-:332: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided
#332: FILE: drivers/gpu/drm/i915/display/intel_display.c:14956:
+ slave_crtc_state->bigjoiner_linked_crtc = master_crtc_state->bigjoiner_linked_crtc = NULL;
-:387: WARNING:BRACES: braces {} are not necessary for any arm of this statement
#387: FILE: drivers/gpu/drm/i915/display/intel_display.c:15351:
+ if (new_crtc_state->bigjoiner) {
[...]
+ } else if (INTEL_GEN(dev_priv) >= 9)
[...]
else
[...]
total: 0 errors, 3 warnings, 5 checks, 401 lines checked
52facad4f0f8 drm/i915: Enable big joiner support in enable and disable sequences.
-:176: WARNING:LONG_LINE_COMMENT: line length of 106 exceeds 100 columns
#176: FILE: drivers/gpu/drm/i915/display/intel_ddi.c:4403:
+ /* Our own transcoder needs to be disabled when reading it in intel_ddi_read_func_ctl() */
-:178: WARNING:LONG_LINE: line length of 104 exceeds 100 columns
#178: FILE: drivers/gpu/drm/i915/display/intel_ddi.c:4405:
+ pipe_config->cpu_transcoder = (enum transcoder)pipe_config->bigjoiner_linked_crtc->pipe;
-:789: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV)
#789: FILE: drivers/gpu/drm/i915/display/intel_display_types.h:829:
+#define PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE (1<<1) /* bigjoiner slave, partial readout */
^
total: 0 errors, 2 warnings, 1 checks, 997 lines checked
01023aaf7c78 drm/i915: Make hardware readout work on i915.
-:33: WARNING:TABSTOP: Statements should start on a tabstop
#33: FILE: drivers/gpu/drm/i915/display/intel_display.c:3609:
+ struct intel_crtc_state *crtc_state =
-:76: WARNING:LONG_LINE: line length of 111 exceeds 100 columns
#76: FILE: drivers/gpu/drm/i915/display/intel_display.c:10694:
+ (intel_de_read(dev_priv, PLANE_SURF(pipe, plane_id)) & 0xfffff000) == plane_config->base) {
total: 0 errors, 2 warnings, 0 checks, 118 lines checked
4f5779f44812 drm/i915: Link planes in a bigjoiner configuration, v3.
-:203: ERROR:CODE_INDENT: code indent should use tabs where possible
#203: FILE: drivers/gpu/drm/i915/display/intel_display.c:12626:
+ * Setup and teardown the new bigjoiner plane mappings.$
-:204: ERROR:CODE_INDENT: code indent should use tabs where possible
#204: FILE: drivers/gpu/drm/i915/display/intel_display.c:12627:
+ */$
-:289: ERROR:CODE_INDENT: code indent should use tabs where possible
#289: FILE: drivers/gpu/drm/i915/display/intel_display.c:12708:
+ *$
-:305: WARNING:LONG_LINE: line length of 105 exceeds 100 columns
#305: FILE: drivers/gpu/drm/i915/display/intel_display.c:12722:
+ for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
-:321: ERROR:CODE_INDENT: code indent should use tabs where possible
#321: FILE: drivers/gpu/drm/i915/display/intel_display.c:12738:
+ * Make sure bigjoiner slave crtc's are also pulled in. This is not done automatically$
-:322: ERROR:CODE_INDENT: code indent should use tabs where possible
#322: FILE: drivers/gpu/drm/i915/display/intel_display.c:12739:
+ * when adding slave planes, because plane_state->crtc is null.$
-:323: ERROR:CODE_INDENT: code indent should use tabs where possible
#323: FILE: drivers/gpu/drm/i915/display/intel_display.c:12740:
+ */$
-:435: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 8)
#435: FILE: drivers/gpu/drm/i915/display/intel_display.h:472:
+ for_each_intel_plane_mask(((crtc_state)->uapi.state->dev), (iter), \
[...]
+ for_each_if ((((plane_state) = \
-:441: WARNING:SPACING: space prohibited between function name and open parenthesis '('
#441: FILE: drivers/gpu/drm/i915/display/intel_display.h:478:
+ for_each_if ((((plane_state) = \
-:442: WARNING:LONG_LINE: line length of 124 exceeds 100 columns
#442: FILE: drivers/gpu/drm/i915/display/intel_display.h:479:
+ to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->uapi.state, &iter->base))), \
-:443: WARNING:LONG_LINE: line length of 109 exceeds 100 columns
#443: FILE: drivers/gpu/drm/i915/display/intel_display.h:480:
+ ((plane) = (plane_state)->bigjoiner_slave ? (plane_state)->bigjoiner_plane : (iter)), \
-:445: WARNING:LONG_LINE: line length of 125 exceeds 100 columns
#445: FILE: drivers/gpu/drm/i915/display/intel_display.h:482:
+ to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->uapi.state, &plane->base)) : \
total: 6 errors, 6 warnings, 0 checks, 481 lines checked
81c299846f0d drm/i915: Add bigjoiner aware plane clipping checks
ce260481299f drm/i915: Add intel_update_bigjoiner handling.
f4de44a552c1 drm/i915: Add debugfs dumping for bigjoiner, v3.
-:46: WARNING:LONG_LINE: line length of 123 exceeds 100 columns
#46: FILE: drivers/gpu/drm/i915/display/intel_display_debugfs.c:777:
+ seq_printf(m, "\t\tuapi: fb=%d,%s,%dx%d, visible=%s, src=" DRM_RECT_FP_FMT ", dst=" DRM_RECT_FMT ", rotation=%s\n",
-:56: WARNING:LONG_LINE: line length of 119 exceeds 100 columns
#56: FILE: drivers/gpu/drm/i915/display/intel_display_debugfs.c:787:
+ plane_state->planar_linked_plane->base.base.id, plane_state->planar_linked_plane->base.name,
-:60: WARNING:LONG_LINE: line length of 111 exceeds 100 columns
#60: FILE: drivers/gpu/drm/i915/display/intel_display_debugfs.c:791:
+ plane_state->bigjoiner_plane->base.base.id, plane_state->bigjoiner_plane->base.name,
total: 0 errors, 3 warnings, 0 checks, 52 lines checked
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* [PATCH][next] i2c: aspeed: Use fallthrough pseudo-keyword
From: Gustavo A. R. Silva @ 2020-07-16 21:52 UTC (permalink / raw)
To: linux-aspeed
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
drivers/i2c/busses/i2c-aspeed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index f51702d86a90..31268074c422 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -504,7 +504,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
goto error_and_stop;
}
irq_handled |= ASPEED_I2CD_INTR_TX_ACK;
- /* fall through */
+ fallthrough;
case ASPEED_I2C_MASTER_TX_FIRST:
if (bus->buf_index < msg->len) {
bus->master_state = ASPEED_I2C_MASTER_TX;
@@ -520,7 +520,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
/* RX may not have completed yet (only address cycle) */
if (!(irq_status & ASPEED_I2CD_INTR_RX_DONE))
goto out_no_complete;
- /* fall through */
+ fallthrough;
case ASPEED_I2C_MASTER_RX:
if (unlikely(!(irq_status & ASPEED_I2CD_INTR_RX_DONE))) {
dev_err(bus->dev, "master failed to RX\n");
--
2.27.0
^ permalink raw reply related
* Re: [RFC PATCH net-next 6/6] ice: implement devlink parameters to control flash update
From: Jacob Keller @ 2020-07-16 21:52 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: netdev, Jiri Pirko, Jesse Brandeburg, Tom Herbert
In-Reply-To: <20200716144208.4e602320@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On 7/16/2020 2:42 PM, Jakub Kicinski wrote:
> On Thu, 16 Jul 2020 14:29:40 -0700 Jacob Keller wrote:
>> On 7/15/2020 5:21 PM, Jacob Keller wrote:
>>> Ok, that seems reasonable. Ofcourse we'll need to find something generic
>>> enough that it can be re-used and isn't driver specific.
>>
>> Hi Jakub,
>>
>> I think I have something that will be more clear and will be sending a
>> new RFC with the change this afternoon:
>>
>> an extension to the DEVLINK_CMD_FLASH_UPDATE with a new parameter,
>> "overwrite" with these values:
>>
>> a) "nothing" (or maybe, "firmware-only" or "binary-only"?, need a way to
>> clarify difference between settings/vital data and firmware program
>> binary) will request that we do not overwrite any settings or fields.
>> This is equivalent to the "PRESERVE_ALL" I had in the original proposal,
>> where we will maintain all settings and all vital data, but update the
>> firmware binary.
>>
>> b) "settings" will request that the firmware overwrite all the settings
>> fields with the contents from the new image. However, vital data such as
>> the PCI Serial ID, VPD section, MAC Addresses, and similar "static" data
>> will be kept (not overwritten). This is the same as the
>> "PRESERVE_LIMITED" option I had in the original proposal
>>
>> c) "all" or "everything" will request that firmware overwrite all
>> contents of the image. This means all settings and all vital data will
>> be overwritten by the contents in the new image.
>
> Sorry but I'm still not 100% sure of what the use for this option is
> beyond an OEM. Is it possible to reset the VPD, board serial, MAC
> address etc. while flashing a FW image downloaded from a support site?
> Would that mean that if I flash a rack with one FW image all NICs will
> start reporting the same serial numbers and use the same MACs?
>
I think the intent here is for OEMs which would generate/customize the
images, though I've also been told it may be useful to get a card out of
some situation where firmware preservation was broken.. (No, I don't
really have more details on what specifically the situation might be).
Obviously in most update cases I don't think we expect this to be used.
>> d) if we need it, a "default" that would be the current behavior of
>> doing whatever the driver default is? (since it's not clear to me what
>> other implementations do but perhaps they all behavior as either
>> "nothing" or "all"?
>
> As a user I'd expect "nothing" to be the default. Same as your OS
> update does not wipe out your settings. I think it's also better
> if the default is decided by Linux, not the drivers.
>
Right, but I wasn't sure what other drivers/devices implement today and
didn't want to end up in a "well we don't behave that way so you just
changed our behavior"..? Hmm. If they all behave this way today then
it's fine to make "nothing" the default and modify all implementations
to reject other options.
>> I think I agree that "factory" settings doesn't really belong here, and
>> I will try to push for finding an alternative way to allow access to
>> that behavior. If we wanted it we could use "from_factory" to request
>> that we overwrite the settings and vital data "from" the factory
>> portion, but I think that is pushing the boundary here a bit...
>>
>> I am aiming to have a new patch up with this proposal
>
> Probably best if we understand the use case more clearly, too. Since
> you have this implemented in your tooling what are the scenarios where
> factory is expected to be preferred over FW default?
>
I'll see if I can gather any further information on both this and the
overwrite-all mode.
My understanding so far is that it is intended as a way to restore the
device settings/config to what was written in the factory. I agree from
Linux perspective having this be a separate command (without requiring
an update) would make the most sense, but that isn't how it was
implemented today.
The factory settings are stored in a separate section of flash so they
aren't modified by normal update flows. I am not sure if there is a
procedure for updating them or if it truly is write-once.
Thanks,
Jake
^ permalink raw reply
* Re: [PATCH v3 3/5] pinctrl: qcom: Use return value from irq_set_wake call
From: Doug Anderson @ 2020-07-16 21:51 UTC (permalink / raw)
To: Linus Walleij
Cc: Maulik Shah, Bjorn Andersson, Marc Zyngier, Stephen Boyd,
Evan Green, Matthias Kaehlcke, linux-kernel@vger.kernel.org, MSM,
open list:GPIO SUBSYSTEM, Andy Gross, Thomas Gleixner,
Jason Cooper, Rajendra Nayak, Lina Iyer,
open list:GPIO SUBSYSTEM <linux-gpio@vger.kernel.org>, Andy Gross <agross@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Jason Cooper <jason@lakedaemon.net>, Doug Anderson <dianders@chromium.org>, Rajendra Nayak <rnayak@codeaurora.org>, Lina Iyer <ilina@codeaurora.org>,
In-Reply-To: <CACRpkdb-3Tf4s5=Gxjhy62GX=HUYkLOcPKZ6JWaLTQipz-0r6A@mail.gmail.com>
Hi,
On Thu, Jul 16, 2020 at 6:19 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Mon, Jun 22, 2020 at 11:32 AM Maulik Shah <mkshah@codeaurora.org> wrote:
>
> > msmgpio irqchip is not using return value of irq_set_wake call.
> > Start using it.
> >
> > Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy")
> > Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
>
> Is this something that's causing regressions so I should apply it for
> fixes, or is it fine to keep this with the rest of the series for v5.9?
I would let Maulik comment more, but as far as I can tell the function
has been ignoring the return value of irq_set_irq_wake() for much
longer. Presumably one could logically say:
Fixes: 6aced33f4974 ("pinctrl: msm: drop wake_irqs bitmap")
...though when you get past the commit that Maulik tagged you need a
backport rather than a straight cherry-pick.
That would make me believe that there is no real hurry to land the fix here.
-Doug
^ permalink raw reply
* [linux-5.4 test] 151939: tolerable FAIL - PUSHED
From: osstest service owner @ 2020-07-16 21:49 UTC (permalink / raw)
To: xen-devel, osstest-admin
flight 151939 linux-5.4 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/151939/
Failures :-/ but no regressions.
Tests which did not succeed, but are not blocking:
test-amd64-i386-libvirt 13 migrate-support-check fail never pass
test-amd64-i386-xl-pvshim 12 guest-start fail never pass
test-amd64-amd64-libvirt 13 migrate-support-check fail never pass
test-amd64-i386-libvirt-xsm 13 migrate-support-check fail never pass
test-arm64-arm64-xl-seattle 13 migrate-support-check fail never pass
test-arm64-arm64-xl-seattle 14 saverestore-support-check fail never pass
test-arm64-arm64-xl-xsm 13 migrate-support-check fail never pass
test-arm64-arm64-xl-xsm 14 saverestore-support-check fail never pass
test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 migrate-support-check fail never pass
test-arm64-arm64-xl 13 migrate-support-check fail never pass
test-arm64-arm64-xl 14 saverestore-support-check fail never pass
test-arm64-arm64-libvirt-xsm 13 migrate-support-check fail never pass
test-arm64-arm64-libvirt-xsm 14 saverestore-support-check fail never pass
test-arm64-arm64-xl-thunderx 13 migrate-support-check fail never pass
test-arm64-arm64-xl-credit1 13 migrate-support-check fail never pass
test-arm64-arm64-xl-thunderx 14 saverestore-support-check fail never pass
test-arm64-arm64-xl-credit1 14 saverestore-support-check fail never pass
test-arm64-arm64-xl-credit2 13 migrate-support-check fail never pass
test-arm64-arm64-xl-credit2 14 saverestore-support-check fail never pass
test-armhf-armhf-xl-multivcpu 13 migrate-support-check fail never pass
test-armhf-armhf-xl-multivcpu 14 saverestore-support-check fail never pass
test-armhf-armhf-xl-credit2 13 migrate-support-check fail never pass
test-armhf-armhf-xl 13 migrate-support-check fail never pass
test-armhf-armhf-xl-arndale 13 migrate-support-check fail never pass
test-armhf-armhf-xl-arndale 14 saverestore-support-check fail never pass
test-armhf-armhf-xl 14 saverestore-support-check fail never pass
test-armhf-armhf-xl-credit2 14 saverestore-support-check fail never pass
test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 11 migrate-support-check fail never pass
test-amd64-amd64-qemuu-nested-amd 17 debian-hvm-install/l1/l2 fail never pass
test-amd64-i386-xl-qemuu-win7-amd64 17 guest-stop fail never pass
test-amd64-i386-xl-qemut-win7-amd64 17 guest-stop fail never pass
test-amd64-amd64-xl-qemut-win7-amd64 17 guest-stop fail never pass
test-armhf-armhf-libvirt 13 migrate-support-check fail never pass
test-armhf-armhf-libvirt 14 saverestore-support-check fail never pass
test-armhf-armhf-xl-cubietruck 13 migrate-support-check fail never pass
test-armhf-armhf-xl-cubietruck 14 saverestore-support-check fail never pass
test-armhf-armhf-xl-vhd 12 migrate-support-check fail never pass
test-armhf-armhf-xl-vhd 13 saverestore-support-check fail never pass
test-armhf-armhf-xl-credit1 13 migrate-support-check fail never pass
test-armhf-armhf-xl-credit1 14 saverestore-support-check fail never pass
test-amd64-amd64-xl-qemuu-ws16-amd64 17 guest-stop fail never pass
test-amd64-amd64-xl-qemut-ws16-amd64 17 guest-stop fail never pass
test-amd64-i386-xl-qemut-ws16-amd64 17 guest-stop fail never pass
test-armhf-armhf-xl-rtds 13 migrate-support-check fail never pass
test-armhf-armhf-xl-rtds 14 saverestore-support-check fail never pass
test-armhf-armhf-libvirt-raw 12 migrate-support-check fail never pass
test-armhf-armhf-libvirt-raw 13 saverestore-support-check fail never pass
test-amd64-i386-xl-qemuu-ws16-amd64 17 guest-stop fail never pass
test-amd64-amd64-libvirt-xsm 13 migrate-support-check fail never pass
test-amd64-amd64-libvirt-vhd 12 migrate-support-check fail never pass
test-amd64-amd64-xl-qemuu-win7-amd64 17 guest-stop fail never pass
version targeted for testing:
linux c57b1153a58a6263863667296b5f00933fc46a4f
baseline version:
linux 1c54d3c15afacf179c07ce6c57a0d43f412f1b3a
Last test of basis 151757 2020-07-09 08:18:27 Z 7 days
Testing same since 151939 2020-07-16 06:40:22 Z 0 days 1 attempts
------------------------------------------------------------
People who touched revisions under test:
Aditya Pakki <pakki001@umn.edu>
Adrian Hunter <adrian.hunter@intel.com>
Alex Deucher <alexander.deucher@amd.com>
Alexandru Elisei <alexandru.elisei@arm.com>
Alexei Starovoitov <ast@kernel.org>
Andre Edich <andre.edich@microchip.com>
Andrew Bowers <andrewx.bowers@intel.com>
Andrew Scull <ascull@google.com>
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Arnaldo Carvalho de Melo <acme@redhat.com>
Aya Levin <ayal@mellanox.com>
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Benjamin Poirier <benjamin.poirier@gmail.com>
Boris Burkov <boris@bur.io>
Charles Keepax <ckeepax@opensource.cirrus.com>
Chengguang Xu <cgxu519@mykernel.net>
Chris Chiu <chiu@endlessm.com>
Christian Borntraeger <borntraeger@de.ibm.com>
Christian König <christian.koenig@amd.com>
Christoph Hellwig <hch@lst.de>
Chun-Kuang Hu <chunkuang.hu@kernel.org>
Ciara Loftus <ciara.loftus@intel.com>
Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Dan Carpenter <dan.carpenter@oracle.com>
Daniel Drake <drake@endlessm.com>
Dany Madden <drt@linux.ibm.com>
David S. Miller <davem@davemloft.net>
David Sterba <dsterba@suse.com>
Davide Caratti <dcaratti@redhat.com>
Dennis Dalessandro <dennis.dalessandro@intel.com>
Divya Indi <divya.indi@oracle.com>
Douglas Anderson <dianders@chromium.org>
Eran Ben Elisha <eranbe@mellanox.com>
Eric Dumazet <edumazet@google.com>
Even Brenden <evenbrenden@gmail.com>
Felipe Balbi <balbi@kernel.org>
Gerald Schaefer <gerald.schaefer@de.ibm.com> # s390
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede <hdegoede@redhat.com>
Hector Martin <marcan@marcan.st>
Heiko Carstens <hca@linux.ibm.com>
Heiko Carstens <heiko.carstens@de.ibm.com>
Hsin-Yi Wang <hsinyi@chromium.org>
Huazhong Tan <tanhuazhong@huawei.com>
Hui Wang <hui.wang@canonical.com>
Huy Nguyen <huyn@mellanox.com>
Ido Schimmel <idosch@mellanox.com>
Igor Russkikh <irusskikh@marvell.com>
Ingo Molnar <mingo@kernel.org>
Jakub Sitnicki <jakub@cloudflare.com>
James Morse <james.morse@arm.com>
Janosch Frank <frankja@linux.ibm.com>
Jason Gunthorpe <jgg@nvidia.com>
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jens Axboe <axboe@kernel.dk>
Jens Thoms Toerring <jt@toerring.de>
Jessica Yu <jeyu@kernel.org>
Jian-Hong Pan <jian-hong@endlessm.com>
Jiri Kosina <jkosina@suse.cz>
Jiri Olsa <jolsa@redhat.com>
Joe Lawrence <joe.lawrence@redhat.com>
Joerg Roedel <jroedel@suse.de>
Johannes Berg <johannes.berg@intel.com>
John Fastabend <john.fastabend@gmail.com>
Jonathan Toppins <jtoppins@redhat.com>
Josef Bacik <josef@toxicpanda.com>
Josh Poimboeuf <jpoimboe@redhat.com>
Kaike Wan <kaike.wan@intel.com>
Kamal Heib <kamalheib1@gmail.com>
Kees Cook <keescook@chromium.org>
Kim Phillips <kim.phillips@amd.com>
Krzysztof Kozlowski <krzk@kernel.org>
Leon Romanovsky <leonro@mellanox.com>
Li Heng <liheng40@huawei.com>
Linus Walleij <linus.walleij@linaro.org>
Lu Baolu <baolu.lu@linux.intel.com>
Luca Coelho <luciano.coelho@intel.com>
Marc Zyngier <maz@kernel.org>
Marco Elver <elver@google.com>
Marek Olšák <marek.olsak@amd.com>
Mark Brown <broonie@kernel.org>
Martin K. Petersen <martin.petersen@oracle.com>
Martin KaFai Lau <kafai@fb.com>
Max Gurtovoy <maxg@mellanox.com>
Michael Ellerman <mpe@ellerman.id.au>
Michal Suchanek <msuchanek@suse.de>
Mike Snitzer <snitzer@redhat.com>
Mikulas Patocka <mpatocka@redhat.com>
Ming Lei <ming.lei@redhat.com>
Miroslav Benes <mbenes@suse.cz>
Namhyung Kim <namhyung@kernel.org>
Neil Armstrong <narmstrong@baylibre.com>
Nicolas Ferre <nicolas.ferre@microchip.com>
Nicolin Chen <nicoleotsuka@gmail.com>
Pablo Neira Ayuso <pablo@netfilter.org>
Paolo Bonzini <pbonzini@redhat.com>
Parthiban Veerasooran <Parthiban.Veerasooran@microchip.com>
Pavel Hofman <pavel.hofman@ivitera.com>
Peng Ma <peng.ma@nxp.com>
Peter Zijlstra (Intel) <peterz@infradead.org>
Peter Zijlstra <peterz@infradead.org>
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Rajat Jain <rajatja@google.com>
Russell King <rmk+kernel@armlinux.org.uk>
Saeed Mahameed <saeedm@mellanox.com>
Sascha Hauer <s.hauer@pengutronix.de>
Sasha Levin <sashal@kernel.org>
Scott Wood <swood@redhat.com>
Sean Christopherson <sean.j.christopherson@intel.com>
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Shawn Guo <shawnguo@kernel.org>
Sowjanya Komatineni <skomatineni@nvidia.com>
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Stanislav Saner <ssaner@redhat.com>
Stephane Eranian <eranian@google.com>
Stephane Eranian <eraniangoogle.com>
Steve French <stfrench@microsoft.com>
Steven Price <steven.price@arm.com>
Sudarsana Reddy Kalluru <skalluru@marvell.com>
Takashi Iwai <tiwai@suse.de>
Thierry Reding <treding@nvidia.com>
Tom Rix <trix@redhat.com>
Tomas Henzl <thenzl@redhat.com>
Tony Lindgren <tony@atomide.com>
Ulf Hansson <ulf.hansson@linaro.org>
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Vasily Gorbik <gor@linux.ibm.com>
Vincent Bernat <vincent@bernat.ch>
Vineet Gupta <vgupta@synopsys.com>
Vinod Koul <vkoul@kernel.org>
Wei Li <liwei391@huawei.com>
Will Deacon <will@kernel.org>
xidongwang <wangxidong_97@163.com>
Xin Tan <tanxin.ctf@gmail.com>
Xiyu Yang <xiyuyang19@fudan.edu.cn>
Yonglong Liu <liuyonglong@huawei.com>
yu kuai <yukuai3@huawei.com>
Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Zheng Bin <zhengbin13@huawei.com>
Zhenzhong Duan <zhenzhong.duan@gmail.com>
jobs:
build-amd64-xsm pass
build-arm64-xsm pass
build-i386-xsm pass
build-amd64 pass
build-arm64 pass
build-armhf pass
build-i386 pass
build-amd64-libvirt pass
build-arm64-libvirt pass
build-armhf-libvirt pass
build-i386-libvirt pass
build-amd64-pvops pass
build-arm64-pvops pass
build-armhf-pvops pass
build-i386-pvops pass
test-amd64-amd64-xl pass
test-amd64-coresched-amd64-xl pass
test-arm64-arm64-xl pass
test-armhf-armhf-xl pass
test-amd64-i386-xl pass
test-amd64-coresched-i386-xl pass
test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm pass
test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm pass
test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm pass
test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm pass
test-amd64-amd64-xl-qemut-debianhvm-i386-xsm pass
test-amd64-i386-xl-qemut-debianhvm-i386-xsm pass
test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm pass
test-amd64-i386-xl-qemuu-debianhvm-i386-xsm pass
test-amd64-amd64-libvirt-xsm pass
test-arm64-arm64-libvirt-xsm pass
test-amd64-i386-libvirt-xsm pass
test-amd64-amd64-xl-xsm pass
test-arm64-arm64-xl-xsm pass
test-amd64-i386-xl-xsm pass
test-amd64-amd64-qemuu-nested-amd fail
test-amd64-amd64-xl-pvhv2-amd pass
test-amd64-i386-qemut-rhel6hvm-amd pass
test-amd64-i386-qemuu-rhel6hvm-amd pass
test-amd64-amd64-xl-qemut-debianhvm-amd64 pass
test-amd64-i386-xl-qemut-debianhvm-amd64 pass
test-amd64-amd64-xl-qemuu-debianhvm-amd64 pass
test-amd64-i386-xl-qemuu-debianhvm-amd64 pass
test-amd64-i386-freebsd10-amd64 pass
test-amd64-amd64-xl-qemuu-ovmf-amd64 pass
test-amd64-i386-xl-qemuu-ovmf-amd64 pass
test-amd64-amd64-xl-qemut-win7-amd64 fail
test-amd64-i386-xl-qemut-win7-amd64 fail
test-amd64-amd64-xl-qemuu-win7-amd64 fail
test-amd64-i386-xl-qemuu-win7-amd64 fail
test-amd64-amd64-xl-qemut-ws16-amd64 fail
test-amd64-i386-xl-qemut-ws16-amd64 fail
test-amd64-amd64-xl-qemuu-ws16-amd64 fail
test-amd64-i386-xl-qemuu-ws16-amd64 fail
test-armhf-armhf-xl-arndale pass
test-amd64-amd64-xl-credit1 pass
test-arm64-arm64-xl-credit1 pass
test-armhf-armhf-xl-credit1 pass
test-amd64-amd64-xl-credit2 pass
test-arm64-arm64-xl-credit2 pass
test-armhf-armhf-xl-credit2 pass
test-armhf-armhf-xl-cubietruck pass
test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict pass
test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict pass
test-amd64-amd64-examine pass
test-arm64-arm64-examine pass
test-armhf-armhf-examine pass
test-amd64-i386-examine pass
test-amd64-i386-freebsd10-i386 pass
test-amd64-amd64-qemuu-nested-intel pass
test-amd64-amd64-xl-pvhv2-intel pass
test-amd64-i386-qemut-rhel6hvm-intel pass
test-amd64-i386-qemuu-rhel6hvm-intel pass
test-amd64-amd64-libvirt pass
test-armhf-armhf-libvirt pass
test-amd64-i386-libvirt pass
test-amd64-amd64-xl-multivcpu pass
test-armhf-armhf-xl-multivcpu pass
test-amd64-amd64-pair pass
test-amd64-i386-pair pass
test-amd64-amd64-libvirt-pair pass
test-amd64-i386-libvirt-pair pass
test-amd64-amd64-amd64-pvgrub pass
test-amd64-amd64-i386-pvgrub pass
test-amd64-amd64-xl-pvshim pass
test-amd64-i386-xl-pvshim fail
test-amd64-amd64-pygrub pass
test-amd64-amd64-xl-qcow2 pass
test-armhf-armhf-libvirt-raw pass
test-amd64-i386-xl-raw pass
test-amd64-amd64-xl-rtds pass
test-armhf-armhf-xl-rtds pass
test-arm64-arm64-xl-seattle pass
test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow pass
test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow pass
test-amd64-amd64-xl-shadow pass
test-amd64-i386-xl-shadow pass
test-arm64-arm64-xl-thunderx pass
test-amd64-amd64-libvirt-vhd pass
test-armhf-armhf-xl-vhd pass
------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images
Logs, config files, etc. are available at
http://logs.test-lab.xenproject.org/osstest/logs
Explanation of these reports, and of osstest in general, is at
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master
Test harness code can be found at
http://xenbits.xen.org/gitweb?p=osstest.git;a=summary
Pushing revision :
hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
1c54d3c15afa..c57b1153a58a c57b1153a58a6263863667296b5f00933fc46a4f -> tested/linux-5.4
^ permalink raw reply
* Re: [PATCH net-next 1/3] ptp: add ability to configure duty cycle for periodic output
From: Vladimir Oltean @ 2020-07-16 21:49 UTC (permalink / raw)
To: Jacob Keller
Cc: kuba, davem, netdev, richardcochran, yangbo.lu, xiaoliang.yang_1,
po.liu, UNGLinuxDriver
In-Reply-To: <56860b5e-95ff-ae59-a20d-9873af44de67@intel.com>
On Thu, Jul 16, 2020 at 02:36:45PM -0700, Jacob Keller wrote:
>
>
> On 7/16/2020 2:20 PM, Vladimir Oltean wrote:
> > There are external event timestampers (PHCs with support for
> > PTP_EXTTS_REQUEST) that timestamp both event edges.
> >
> > When those edges are very close (such as in the case of a short pulse),
> > there is a chance that the collected timestamp might be of the rising,
> > or of the falling edge, we never know.
> >
> > There are also PHCs capable of generating periodic output with a
> > configurable duty cycle. This is good news, because we can space the
> > rising and falling edge out enough in time, that the risks to overrun
> > the 1-entry timestamp FIFO of the extts PHC are lower (example: the
> > perout PHC can be configured for a period of 1 second, and an "on" time
> > of 0.5 seconds, resulting in a duty cycle of 50%).
> >
> > A flag is introduced for signaling that an on time is present in the
> > perout request structure, for preserving compatibility. Logically
> > speaking, the duty cycle cannot exceed 100% and the PTP core checks for
> > this.
>
> I was thinking whether it made sense to support over 50% since in theory
> you could change start time and the duty cycle to specify the shifted
> wave over? but I guess it doesn't really make much of a difference to
> support all the way up to 100%.
>
Only if you also support polarity, and we don't support polarity. It's
always high first, then low.
+------+ +------+ +------+ +------+ +------+ +------+ +------+
| | | | | | | | | | | | | |
--+ +--+ +--+ +--+ +--+ +--+ +--+ +
+---------+---------+---------+---------+---------+---------+--------->
period=10 time
phase=2
on = 7
There's no other way to obtain this signal which has a duty cycle > 50%
by specifying a duty cycle < 50%.
> >
> > PHC drivers that don't support this flag emit a periodic output of an
> > unspecified duty cycle, same as before.
> >
> > The duty cycle is encoded as an "on" time, similar to the "start" and
> > "period" times, and reuses the reserved space while preserving overall
> > binary layout.
> >
> > Pahole reported before:
> >
> > struct ptp_perout_request {
> > struct ptp_clock_time start; /* 0 16 */
> > struct ptp_clock_time period; /* 16 16 */
> > unsigned int index; /* 32 4 */
> > unsigned int flags; /* 36 4 */
> > unsigned int rsv[4]; /* 40 16 */
> >
> > /* size: 56, cachelines: 1, members: 5 */
> > /* last cacheline: 56 bytes */
> > };
> >
> > And now:
> >
> > struct ptp_perout_request {
> > struct ptp_clock_time start; /* 0 16 */
> > struct ptp_clock_time period; /* 16 16 */
> > unsigned int index; /* 32 4 */
> > unsigned int flags; /* 36 4 */
> > union {
> > struct ptp_clock_time on; /* 40 16 */
> > unsigned int rsv[4]; /* 40 16 */
> > }; /* 40 16 */
> >
> > /* size: 56, cachelines: 1, members: 5 */
> > /* last cacheline: 56 bytes */
> > };
> >
> > Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
> > ---
> > drivers/ptp/ptp_chardev.c | 33 +++++++++++++++++++++++++++------
> > include/uapi/linux/ptp_clock.h | 17 ++++++++++++++---
> > 2 files changed, 41 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
> > index 375cd6e4aade..e0e6f85966e1 100644
> > --- a/drivers/ptp/ptp_chardev.c
> > +++ b/drivers/ptp/ptp_chardev.c
> > @@ -191,12 +191,33 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
> > err = -EFAULT;
> > break;
> > }
> > - if (((req.perout.flags & ~PTP_PEROUT_VALID_FLAGS) ||
> > - req.perout.rsv[0] || req.perout.rsv[1] ||
> > - req.perout.rsv[2] || req.perout.rsv[3]) &&
> > - cmd == PTP_PEROUT_REQUEST2) {
> > - err = -EINVAL;
> > - break;
> > + if (cmd == PTP_PEROUT_REQUEST2) {
> > + struct ptp_perout_request *perout = &req.perout;
> > +
> > + if (perout->flags & ~PTP_PEROUT_VALID_FLAGS) {
> > + err = -EINVAL;
> > + break;
> > + }
> > + /*
> > + * The "on" field has undefined meaning if
> > + * PTP_PEROUT_DUTY_CYCLE isn't set, we must still treat
> > + * it as reserved, which must be set to zero.
> > + */
> > + if (!(perout->flags & PTP_PEROUT_DUTY_CYCLE) &&
> > + (perout->rsv[0] || perout->rsv[1] ||
> > + perout->rsv[2] || perout->rsv[3])) {
> > + err = -EINVAL;
> > + break;
> > + }
> > + if (perout->flags & PTP_PEROUT_DUTY_CYCLE) {
> > + /* The duty cycle must be subunitary. */
>
> I'm sure this means "smaller than the period" but I can't help thinking
> just spelling that out would be clearer.
>
Duty cycle is by definition a fraction. In my example above, on/period
is 70%, or 0.7. So it is not incorrect to say that the duty cycle is
subunitary. The alternative phrasing would be that the on time must be
lower than the period, and I've used that already in the header file. I
was just trying to avoid repetition.
> > + if (perout->on.sec > perout->period.sec ||
> > + (perout->on.sec == perout->period.sec &&
> > + perout->on.nsec > perout->period.nsec)) {
> > + err = -ERANGE;
> > + break;
> > + }
> > + }
> > } else if (cmd == PTP_PEROUT_REQUEST) {
> > req.perout.flags &= PTP_PEROUT_V1_VALID_FLAGS;
> > req.perout.rsv[0] = 0;
> > diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h
> > index ff070aa64278..1d2841155f7d 100644
> > --- a/include/uapi/linux/ptp_clock.h
> > +++ b/include/uapi/linux/ptp_clock.h
> > @@ -53,12 +53,14 @@
> > /*
> > * Bits of the ptp_perout_request.flags field:
> > */
> > -#define PTP_PEROUT_ONE_SHOT (1<<0)
> > +#define PTP_PEROUT_ONE_SHOT (1<<0)
> > +#define PTP_PEROUT_DUTY_CYCLE (1<<1)
> >
> > /*
> > * flag fields valid for the new PTP_PEROUT_REQUEST2 ioctl.
> > */
> > -#define PTP_PEROUT_VALID_FLAGS (PTP_PEROUT_ONE_SHOT)
> > +#define PTP_PEROUT_VALID_FLAGS (PTP_PEROUT_ONE_SHOT | \
> > + PTP_PEROUT_DUTY_CYCLE)
> >
> > /*
> > * No flags are valid for the original PTP_PEROUT_REQUEST ioctl
> > @@ -105,7 +107,16 @@ struct ptp_perout_request {
> > struct ptp_clock_time period; /* Desired period, zero means disable. */
> > unsigned int index; /* Which channel to configure. */
> > unsigned int flags;
> > - unsigned int rsv[4]; /* Reserved for future use. */
> > + union {
> > + /*
> > + * The "on" time of the signal.
> > + * Must be lower than the period.
> > + * Valid only if (flags & PTP_PEROUT_DUTY_CYCLE) is set.
> > + */
> > + struct ptp_clock_time on;
> > + /* Reserved for future use. */
> > + unsigned int rsv[4];
> > + };
>
> Hmmm. So the idea is that if PTP_PEROUT_DUTY_CYCLE is not set, then we
> keep this as reserved and then if it *is* set we allow it to be the "on"
> time?
>
> Is it possible for us to still use the reserved bits for another
> purpose? Or should we just remove it entirely and leave only the "on"
> timestamp. Any future extension would by definition *have* to be
> exclusive with PTP_PEROUT_DUTY_CYCLE if it wants to use these reserved
> fields anyways...
>
You're right about the mutual exclusion, but I can't predict the future
and I don't know if the reserved field is going to be practically useful
or not.
There is one subtlety though, and that is that we have been exposing to
user space, previously, a structure with a field named "rsv" in it. So,
application writers may have been accessing that "rsv" field, to memset
it to zero, for instance. It wouldn't be nice if it disappeared, it
would break their code.
> > };
> >
> > #define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */
> >
Thanks,
-Vladimir
^ permalink raw reply
* [PATCH][next] i2c: mv64xxx: Use fallthrough pseudo-keyword
From: Gustavo A. R. Silva @ 2020-07-16 21:54 UTC (permalink / raw)
To: Gregory CLEMENT; +Cc: linux-i2c, linux-kernel, Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
drivers/i2c/busses/i2c-mv64xxx.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 829b8c98ae51..8d9d4ffdcd24 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -251,7 +251,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK;
break;
}
- /* FALLTHRU */
+ fallthrough;
case MV64XXX_I2C_STATUS_MAST_WR_ADDR_2_ACK: /* 0xd0 */
case MV64XXX_I2C_STATUS_MAST_WR_ACK: /* 0x28 */
if ((drv_data->bytes_left == 0)
@@ -282,14 +282,14 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK;
break;
}
- /* FALLTHRU */
+ fallthrough;
case MV64XXX_I2C_STATUS_MAST_RD_ADDR_2_ACK: /* 0xe0 */
if (drv_data->bytes_left == 0) {
drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP;
drv_data->state = MV64XXX_I2C_STATE_IDLE;
break;
}
- /* FALLTHRU */
+ fallthrough;
case MV64XXX_I2C_STATUS_MAST_RD_DATA_ACK: /* 0x50 */
if (status != MV64XXX_I2C_STATUS_MAST_RD_DATA_ACK)
drv_data->action = MV64XXX_I2C_ACTION_CONTINUE;
@@ -417,8 +417,7 @@ mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data)
"mv64xxx_i2c_do_action: Invalid action: %d\n",
drv_data->action);
drv_data->rc = -EIO;
-
- /* FALLTHRU */
+ fallthrough;
case MV64XXX_I2C_ACTION_SEND_STOP:
drv_data->cntl_bits &= ~MV64XXX_I2C_REG_CONTROL_INTEN;
writel(drv_data->cntl_bits | MV64XXX_I2C_REG_CONTROL_STOP,
--
2.27.0
^ permalink raw reply related
* [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_exec_balancer: Race breadcrumb signaling against timeslicing
From: Patchwork @ 2020-07-16 21:48 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev
In-Reply-To: <20200716204448.737869-1-chris@chris-wilson.co.uk>
[-- Attachment #1.1: Type: text/plain, Size: 6650 bytes --]
== Series Details ==
Series: i915/gem_exec_balancer: Race breadcrumb signaling against timeslicing
URL : https://patchwork.freedesktop.org/series/79566/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8758 -> IGTPW_4772
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/index.html
Known issues
------------
Here are the changes found in IGTPW_4772 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_flink_basic@bad-open:
- fi-tgl-y: [PASS][1] -> [DMESG-WARN][2] ([i915#402])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-tgl-y/igt@gem_flink_basic@bad-open.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-tgl-y/igt@gem_flink_basic@bad-open.html
* igt@i915_selftest@live@active:
- fi-apl-guc: [PASS][3] -> [DMESG-FAIL][4] ([i915#1635] / [i915#666])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-apl-guc/igt@i915_selftest@live@active.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-apl-guc/igt@i915_selftest@live@active.html
* igt@i915_selftest@live@gem_contexts:
- fi-tgl-u2: [PASS][5] -> [INCOMPLETE][6] ([i915#2045])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-tgl-u2/igt@i915_selftest@live@gem_contexts.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-tgl-u2/igt@i915_selftest@live@gem_contexts.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-tgl-y: [PASS][7] -> [DMESG-WARN][8] ([i915#1982]) +1 similar issue
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-tgl-y/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-tgl-y/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
* igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1:
- fi-icl-u2: [PASS][9] -> [DMESG-WARN][10] ([i915#1982])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-icl-u2/igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-icl-u2/igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1.html
#### Possible fixes ####
* igt@i915_module_load@reload:
- {fi-tgl-dsi}: [DMESG-WARN][11] ([i915#1982]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-tgl-dsi/igt@i915_module_load@reload.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-tgl-dsi/igt@i915_module_load@reload.html
* igt@i915_pm_rpm@module-reload:
- fi-skl-6700k2: [INCOMPLETE][13] ([i915#151]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-skl-6700k2/igt@i915_pm_rpm@module-reload.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-skl-6700k2/igt@i915_pm_rpm@module-reload.html
* igt@i915_selftest@live@coherency:
- fi-gdg-551: [DMESG-FAIL][15] ([i915#1748]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-gdg-551/igt@i915_selftest@live@coherency.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-gdg-551/igt@i915_selftest@live@coherency.html
* igt@vgem_basic@setversion:
- fi-tgl-y: [DMESG-WARN][17] ([i915#402]) -> [PASS][18] +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-tgl-y/igt@vgem_basic@setversion.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-tgl-y/igt@vgem_basic@setversion.html
* igt@vgem_basic@unload:
- fi-blb-e6850: [INCOMPLETE][19] -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-blb-e6850/igt@vgem_basic@unload.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-blb-e6850/igt@vgem_basic@unload.html
#### Warnings ####
* igt@i915_module_load@reload:
- fi-tgl-u2: [DMESG-WARN][21] ([i915#402]) -> [DMESG-WARN][22] ([i915#1982])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-tgl-u2/igt@i915_module_load@reload.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-tgl-u2/igt@i915_module_load@reload.html
* igt@kms_force_connector_basic@force-edid:
- fi-kbl-x1275: [DMESG-WARN][23] ([i915#62] / [i915#92]) -> [DMESG-WARN][24] ([i915#62] / [i915#92] / [i915#95]) +2 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html
* igt@prime_vgem@basic-fence-flip:
- fi-kbl-x1275: [DMESG-WARN][25] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][26] ([i915#62] / [i915#92]) +1 similar issue
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8758/fi-kbl-x1275/igt@prime_vgem@basic-fence-flip.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/fi-kbl-x1275/igt@prime_vgem@basic-fence-flip.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#151]: https://gitlab.freedesktop.org/drm/intel/issues/151
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#1748]: https://gitlab.freedesktop.org/drm/intel/issues/1748
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2045]: https://gitlab.freedesktop.org/drm/intel/issues/2045
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#666]: https://gitlab.freedesktop.org/drm/intel/issues/666
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (45 -> 40)
------------------------------
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_5738 -> IGTPW_4772
CI-20190529: 20190529
CI_DRM_8758: b6738761bde03de00a1c84c6a85f9379f53f585c @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_4772: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/index.html
IGT_5738: bc8b56fe177af34fbde7b96f1f66614a0014c6ef @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Testlist changes ==
+igt@gem_exec_balancer@waits
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4772/index.html
[-- Attachment #1.2: Type: text/html, Size: 8371 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply
* [PATCH][next] i2c: aspeed: Use fallthrough pseudo-keyword
From: Gustavo A. R. Silva @ 2020-07-16 21:52 UTC (permalink / raw)
To: Brendan Higgins, Benjamin Herrenschmidt, Joel Stanley,
Andrew Jeffery
Cc: linux-aspeed, Gustavo A. R. Silva, openbmc, linux-kernel,
linux-i2c, linux-arm-kernel
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
drivers/i2c/busses/i2c-aspeed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index f51702d86a90..31268074c422 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -504,7 +504,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
goto error_and_stop;
}
irq_handled |= ASPEED_I2CD_INTR_TX_ACK;
- /* fall through */
+ fallthrough;
case ASPEED_I2C_MASTER_TX_FIRST:
if (bus->buf_index < msg->len) {
bus->master_state = ASPEED_I2C_MASTER_TX;
@@ -520,7 +520,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
/* RX may not have completed yet (only address cycle) */
if (!(irq_status & ASPEED_I2CD_INTR_RX_DONE))
goto out_no_complete;
- /* fall through */
+ fallthrough;
case ASPEED_I2C_MASTER_RX:
if (unlikely(!(irq_status & ASPEED_I2CD_INTR_RX_DONE))) {
dev_err(bus->dev, "master failed to RX\n");
--
2.27.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH][next] i2c: aspeed: Use fallthrough pseudo-keyword
From: Gustavo A. R. Silva @ 2020-07-16 21:52 UTC (permalink / raw)
To: Brendan Higgins, Benjamin Herrenschmidt, Joel Stanley,
Andrew Jeffery
Cc: linux-i2c, openbmc, linux-arm-kernel, linux-aspeed, linux-kernel,
Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
drivers/i2c/busses/i2c-aspeed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index f51702d86a90..31268074c422 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -504,7 +504,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
goto error_and_stop;
}
irq_handled |= ASPEED_I2CD_INTR_TX_ACK;
- /* fall through */
+ fallthrough;
case ASPEED_I2C_MASTER_TX_FIRST:
if (bus->buf_index < msg->len) {
bus->master_state = ASPEED_I2C_MASTER_TX;
@@ -520,7 +520,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
/* RX may not have completed yet (only address cycle) */
if (!(irq_status & ASPEED_I2CD_INTR_RX_DONE))
goto out_no_complete;
- /* fall through */
+ fallthrough;
case ASPEED_I2C_MASTER_RX:
if (unlikely(!(irq_status & ASPEED_I2CD_INTR_RX_DONE))) {
dev_err(bus->dev, "master failed to RX\n");
--
2.27.0
^ permalink raw reply related
* Re: [PATCH v2 1/4] perf-probe: Avoid setting probes on same address on same event
From: Arnaldo Carvalho de Melo @ 2020-07-16 21:47 UTC (permalink / raw)
To: Masami Hiramatsu
Cc: Arnaldo Carvalho de Melo, Oleg Nesterov, Srikar Dronamraju,
linux-kernel, Andi Kleen, Andi Kleen
In-Reply-To: <159438666401.62703.15196394835032087840.stgit@devnote2>
Em Fri, Jul 10, 2020 at 10:11:04PM +0900, Masami Hiramatsu escreveu:
> There is a case that the several same-name symbols points
> same address. In that case, perf probe returns an error.
>
> E.g.
>
> perf probe -x /lib64/libc-2.30.so -v -a "memcpy arg1=%di"
> probe-definition(0): memcpy arg1=%di
> symbol:memcpy file:(null) line:0 offset:0 return:0 lazy:(null)
> parsing arg: arg1=%di into name:arg1 %di
> 1 arguments
> symbol:setjmp file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:longjmp file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:longjmp_target file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:lll_lock_wait_private file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt_arena_max file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt_arena_test file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_tunable_tcache_max_bytes file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_tunable_tcache_count file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_tunable_tcache_unsorted_limit file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt_trim_threshold file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt_top_pad file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt_mmap_threshold file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt_mmap_max file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt_perturb file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt_mxfast file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_heap_new file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_arena_reuse_free_list file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_arena_reuse file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_arena_reuse_wait file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_arena_new file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_arena_retry file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_sbrk_less file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_heap_free file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_heap_less file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_tcache_double_free file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_heap_more file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_sbrk_more file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_malloc_retry file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_memalign_retry file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt_free_dyn_thresholds file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_realloc_retry file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_calloc_retry file:(null) line:0 offset:0 return:0 lazy:(null)
> symbol:memory_mallopt file:(null) line:0 offset:0 return:0 lazy:(null)
> Open Debuginfo file: /usr/lib/debug/usr/lib64/libc-2.30.so.debug
> Try to find probe point from debuginfo.
> Opening /sys/kernel/debug/tracing//README write=0
> Failed to find the location of the '%di' variable at this address.
> Perhaps it has been optimized out.
> Use -V with the --range option to show '%di' location range.
> An error occurred in debuginfo analysis (-2).
> Trying to use symbols.
> Opening /sys/kernel/debug/tracing//uprobe_events write=1
> Writing event: p:probe_libc/memcpy /usr/lib64/libc-2.30.so:0x914c0 arg1=%di
> Writing event: p:probe_libc/memcpy /usr/lib64/libc-2.30.so:0x914c0 arg1=%di
> Failed to write event: File exists
> Error: Failed to add events. Reason: File exists (Code: -17)
>
> You can see the perf tried to write completely same probe definition
> twice, which caused an error.
>
> To fix this issue, check the symbol list and drop duplicated
> symbols (which has same symbol name and address) from it.
>
> With this patch;
>
> # perf probe -x /lib64/libc-2.30.so -a "memcpy arg1=%di"
> Failed to find the location of the '%di' variable at this address.
> Perhaps it has been optimized out.
> Use -V with the --range option to show '%di' location range.
> Added new events:
> probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di)
> probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di)
>
> You can now use it in all perf tools, such as:
>
> perf record -e probe_libc:memcpy -aR sleep 1
>
>
> Reported-by: Andi Kleen <andi@firstfloor.org>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> ---
> Changes in V2
> - Change "find" word to "Found".
> ---
> tools/perf/util/probe-event.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index df713a5d1e26..8cd1224e5f4c 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -2968,6 +2968,16 @@ static int find_probe_trace_events_from_map(struct perf_probe_event *pev,
> for (j = 0; j < num_matched_functions; j++) {
> sym = syms[j];
>
> + /* There can be duplicated symbols in the map */
> + for (i = 0; i < j; i++)
> + if (sym->start == syms[i]->start) {
> + pr_debug("Found duplicated symbol %s @ %lx\n",
> + sym->name, sym->start);
> + break;
> + }
Breaks 32-bit builds with:
CC /tmp/build/perf/util/demangle-java.o
In file included from util/probe-event.c:27:
util/probe-event.c: In function 'find_probe_trace_events_from_map':
util/probe-event.c:2978:14: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'u64' {aka 'long long unsigned int'} [-Werror=format=]
pr_debug("Found duplicated symbol %s @ %lx\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util/debug.h:17:21: note: in definition of macro 'pr_fmt'
#define pr_fmt(fmt) fmt
^~~
util/probe-event.c:2978:5: note: in expansion of macro 'pr_debug'
pr_debug("Found duplicated symbol %s @ %lx\n",
^~~~~~~~
CC /tmp/build/perf/util/demangle-rust.o
I'll change this to use PRIx64.
- Arnaldo
> + if (i != j)
> + continue;
> +
> tev = (*tevs) + ret;
> tp = &tev->point;
> if (ret == num_matched_functions) {
>
--
- Arnaldo
^ permalink raw reply
* + mmhwpoison-introduce-mf_msg_unsplit_thp.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, osalvador,
tony.luck, zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: introduce MF_MSG_UNSPLIT_THP
has been added to the -mm tree. Its filename is
mmhwpoison-introduce-mf_msg_unsplit_thp.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-introduce-mf_msg_unsplit_thp.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-introduce-mf_msg_unsplit_thp.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Oscar Salvador <osalvador@suse.de>
Subject: mm,hwpoison: introduce MF_MSG_UNSPLIT_THP
memory_failure() is supposed to call action_result() when it handles
a memory error event, but there's one missing case. So let's add it.
I find that include/ras/ras_event.h has some other MF_MSG_* undefined,
so this patch also adds them.
Link: http://lkml.kernel.org/r/20200716123810.25292-16-osalvador@suse.de
Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Oscar Salvador <osalvador@suse.com
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/mm.h | 1 +
include/ras/ras_event.h | 3 +++
mm/memory-failure.c | 5 ++++-
3 files changed, 8 insertions(+), 1 deletion(-)
--- a/include/linux/mm.h~mmhwpoison-introduce-mf_msg_unsplit_thp
+++ a/include/linux/mm.h
@@ -3030,6 +3030,7 @@ enum mf_action_page_type {
MF_MSG_BUDDY,
MF_MSG_BUDDY_2ND,
MF_MSG_DAX,
+ MF_MSG_UNSPLIT_THP,
MF_MSG_UNKNOWN,
};
--- a/include/ras/ras_event.h~mmhwpoison-introduce-mf_msg_unsplit_thp
+++ a/include/ras/ras_event.h
@@ -361,6 +361,7 @@ TRACE_EVENT(aer_event,
EM ( MF_MSG_POISONED_HUGE, "huge page already hardware poisoned" ) \
EM ( MF_MSG_HUGE, "huge page" ) \
EM ( MF_MSG_FREE_HUGE, "free huge page" ) \
+ EM ( MF_MSG_NON_PMD_HUGE, "non-pmd-sized huge page" ) \
EM ( MF_MSG_UNMAP_FAILED, "unmapping failed page" ) \
EM ( MF_MSG_DIRTY_SWAPCACHE, "dirty swapcache page" ) \
EM ( MF_MSG_CLEAN_SWAPCACHE, "clean swapcache page" ) \
@@ -373,6 +374,8 @@ TRACE_EVENT(aer_event,
EM ( MF_MSG_TRUNCATED_LRU, "already truncated LRU page" ) \
EM ( MF_MSG_BUDDY, "free buddy page" ) \
EM ( MF_MSG_BUDDY_2ND, "free buddy page (2nd try)" ) \
+ EM ( MF_MSG_DAX, "dax page" ) \
+ EM ( MF_MSG_UNSPLIT_THP, "unsplit thp" ) \
EMe ( MF_MSG_UNKNOWN, "unknown page" )
/*
--- a/mm/memory-failure.c~mmhwpoison-introduce-mf_msg_unsplit_thp
+++ a/mm/memory-failure.c
@@ -569,6 +569,7 @@ static const char * const action_page_ty
[MF_MSG_BUDDY] = "free buddy page",
[MF_MSG_BUDDY_2ND] = "free buddy page (2nd try)",
[MF_MSG_DAX] = "dax page",
+ [MF_MSG_UNSPLIT_THP] = "unsplit thp",
[MF_MSG_UNKNOWN] = "unknown page",
};
@@ -1359,8 +1360,10 @@ int memory_failure(unsigned long pfn, in
}
if (PageTransHuge(hpage)) {
- if (try_to_split_thp_page(p, "Memory Failure") < 0)
+ if (try_to_split_thp_page(p, "Memory Failure") < 0) {
+ action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED);
return -EBUSY;
+ }
VM_BUG_ON_PAGE(!page_count(p), p);
}
_
Patches currently in -mm which might be from osalvador@suse.de are
mmmadvise-refactor-madvise_inject_error.patch
mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
mmhwpoison-kill-put_hwpoison_page.patch
mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
mmhwpoison-rework-soft-offline-for-free-pages.patch
mmhwpoison-rework-soft-offline-for-in-use-pages.patch
mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
mmhwpoison-introduce-mf_msg_unsplit_thp.patch
^ permalink raw reply
* + mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, osalvador,
tony.luck, zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: return 0 if the page is already poisoned in soft-offline
has been added to the -mm tree. Its filename is
mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Oscar Salvador <osalvador@suse.de>
Subject: mm,hwpoison: return 0 if the page is already poisoned in soft-offline
Currently, there is an inconsistency when calling soft-offline from
different paths on a page that is already poisoned.
1) madvise:
madvise_inject_error skips any poisoned page and continues
the loop.
If that was the only page to madvise, it returns 0.
2) /sys/devices/system/memory/:
When calling soft_offline_page_store()->soft_offline_page(),
we return -EBUSY in case the page is already poisoned.
This is inconsistent with a) the above example and b)
memory_failure, where we return 0 if the page was poisoned.
Fix this by dropping the PageHWPoison() check in madvise_inject_error, and
let soft_offline_page return 0 if it finds the page already poisoned.
Please, note that this represents a user-api change, since now the return
error when calling soft_offline_page_store()->soft_offline_page() will be
different.
Link: http://lkml.kernel.org/r/20200716123810.25292-15-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/madvise.c | 3 ---
mm/memory-failure.c | 4 ++--
2 files changed, 2 insertions(+), 5 deletions(-)
--- a/mm/madvise.c~mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline
+++ a/mm/madvise.c
@@ -903,9 +903,6 @@ static int madvise_inject_error(int beha
*/
put_page(page);
- if (PageHWPoison(page))
- continue;
-
if (behavior == MADV_SOFT_OFFLINE) {
pr_info("Soft offlining pfn %#lx at process virtual address %#lx\n",
pfn, start);
--- a/mm/memory-failure.c~mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline
+++ a/mm/memory-failure.c
@@ -1781,7 +1781,7 @@ static int __soft_offline_page(struct pa
unlock_page(page);
put_page(page);
pr_info("soft offline: %#lx page already poisoned\n", pfn);
- return -EBUSY;
+ return 0;
}
if (!PageHuge(page))
@@ -1881,7 +1881,7 @@ int soft_offline_page(unsigned long pfn)
if (PageHWPoison(page)) {
pr_info("soft offline: %#lx page already poisoned\n", pfn);
- return -EBUSY;
+ return 0;
}
get_online_mems();
_
Patches currently in -mm which might be from osalvador@suse.de are
mmmadvise-refactor-madvise_inject_error.patch
mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
mmhwpoison-kill-put_hwpoison_page.patch
mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
mmhwpoison-rework-soft-offline-for-free-pages.patch
mmhwpoison-rework-soft-offline-for-in-use-pages.patch
mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
mmhwpoison-introduce-mf_msg_unsplit_thp.patch
^ permalink raw reply
* + mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, osalvador,
tony.luck, zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: refactor soft_offline_huge_page and __soft_offline_page
has been added to the -mm tree. Its filename is
mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Oscar Salvador <osalvador@suse.de>
Subject: mm,hwpoison: refactor soft_offline_huge_page and __soft_offline_page
Merging soft_offline_huge_page and __soft_offline_page let us get rid of
quite some duplicated code, and makes the code much easier to follow.
Now, __soft_offline_page will handle both normal and hugetlb pages.
Note that move put_page() block to the beginning of page_handle_poison()
with drain_all_pages() in order to make sure that the target page is freed
and sent into free list to make take_page_off_buddy() work properly.
Link: http://lkml.kernel.org/r/20200716123810.25292-14-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.com>
Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memory-failure.c | 141 +++++++++++++++---------------------------
1 file changed, 52 insertions(+), 89 deletions(-)
--- a/mm/memory-failure.c~mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page
+++ a/mm/memory-failure.c
@@ -1723,62 +1723,50 @@ static int get_any_page(struct page *pag
return ret;
}
-static int soft_offline_huge_page(struct page *page)
+static bool isolate_page(struct page *page, struct list_head *pagelist)
{
- int ret = -EBUSY;
- unsigned long pfn = page_to_pfn(page);
- struct page *hpage = compound_head(page);
- LIST_HEAD(pagelist);
+ bool isolated = false;
+ bool lru = PageLRU(page);
- /*
- * This double-check of PageHWPoison is to avoid the race with
- * memory_failure(). See also comment in __soft_offline_page().
- */
- lock_page(hpage);
- if (PageHWPoison(hpage)) {
- unlock_page(hpage);
- put_page(hpage);
- pr_info("soft offline: %#lx hugepage already poisoned\n", pfn);
- return -EBUSY;
+ if (PageHuge(page)) {
+ isolated = isolate_huge_page(page, pagelist);
+ } else {
+ if (lru)
+ isolated = !isolate_lru_page(page);
+ else
+ isolated = !isolate_movable_page(page, ISOLATE_UNEVICTABLE);
+
+ if (isolated)
+ list_add(&page->lru, pagelist);
}
- unlock_page(hpage);
- ret = isolate_huge_page(hpage, &pagelist);
+ if (isolated && lru)
+ inc_node_page_state(page, NR_ISOLATED_ANON +
+ page_is_file_lru(page));
+
/*
- * get_any_page() and isolate_huge_page() takes a refcount each,
- * so need to drop one here.
+ * If we succeed to isolate the page, we grabbed another refcount on
+ * the page, so we can safely drop the one we got from get_any_pages().
+ * If we failed to isolate the page, it means that we cannot go further
+ * and we will return an error, so drop the reference we got from
+ * get_any_pages() as well.
*/
- put_page(hpage);
- if (!ret) {
- pr_info("soft offline: %#lx hugepage failed to isolate\n", pfn);
- return -EBUSY;
- }
-
- ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL,
- MIGRATE_SYNC, MR_MEMORY_FAILURE);
- if (ret) {
- pr_info("soft offline: %#lx: hugepage migration failed %d, type %lx (%pGp)\n",
- pfn, ret, page->flags, &page->flags);
- if (!list_empty(&pagelist))
- putback_movable_pages(&pagelist);
- if (ret > 0)
- ret = -EIO;
- } else {
- /*
- * At this point the page cannot be in-use since we do not
- * let the page to go back to hugetlb freelists.
- * In that case we just need to dissolve it.
- * page_handle_poison will take care of it.
- */
- page_handle_poison(page, true, true, true);
- }
- return ret;
+ put_page(page);
+ return isolated;
}
+/*
+ * __soft_offline_page handles hugetlb-pages and non-hugetlb pages.
+ * If the page is a non-dirty unmapped page-cache page, it simply invalidates.
+ */
static int __soft_offline_page(struct page *page)
{
- int ret;
+ int ret = 0;
unsigned long pfn = page_to_pfn(page);
+ struct page *hpage = compound_head(page);
+ const char *msg_page[] = {"page", "hugepage"};
+ bool huge = PageHuge(page);
+ LIST_HEAD(pagelist);
/*
* Check PageHWPoison again inside page lock because PageHWPoison
@@ -1787,88 +1775,63 @@ static int __soft_offline_page(struct pa
* so there's no race between soft_offline_page() and memory_failure().
*/
lock_page(page);
- wait_on_page_writeback(page);
+ if (!PageHuge(page))
+ wait_on_page_writeback(page);
if (PageHWPoison(page)) {
unlock_page(page);
put_page(page);
pr_info("soft offline: %#lx page already poisoned\n", pfn);
return -EBUSY;
}
- /*
- * Try to invalidate first. This should work for
- * non dirty unmapped page cache pages.
- */
- ret = invalidate_inode_page(page);
+
+ if (!PageHuge(page))
+ /*
+ * Try to invalidate first. This should work for
+ * non dirty unmapped page cache pages.
+ */
+ ret = invalidate_inode_page(page);
unlock_page(page);
+
/*
* RED-PEN would be better to keep it isolated here, but we
* would need to fix isolation locking first.
*/
if (ret == 1) {
pr_info("soft_offline: %#lx: invalidated\n", pfn);
- page_handle_poison(page, true, true, false);
+ page_handle_poison(page, false, true, false);
return 0;
}
- /*
- * Simple invalidation didn't work.
- * Try to migrate to a new page instead. migrate.c
- * handles a large number of cases for us.
- */
- if (PageLRU(page))
- ret = isolate_lru_page(page);
- else
- ret = isolate_movable_page(page, ISOLATE_UNEVICTABLE);
- /*
- * Drop page reference which is came from get_any_page()
- * successful isolate_lru_page() already took another one.
- */
- put_page(page);
- if (!ret) {
- LIST_HEAD(pagelist);
- /*
- * After isolated lru page, the PageLRU will be cleared,
- * so use !__PageMovable instead for LRU page's mapping
- * cannot have PAGE_MAPPING_MOVABLE.
- */
- if (!__PageMovable(page))
- inc_node_page_state(page, NR_ISOLATED_ANON +
- page_is_file_lru(page));
- list_add(&page->lru, &pagelist);
- ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL,
+ if (isolate_page(hpage, &pagelist)) {
+ ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL,
MIGRATE_SYNC, MR_MEMORY_FAILURE);
if (!ret) {
- page_handle_poison(page, true, true, false);
+ page_handle_poison(page, true, true, huge);
} else {
if (!list_empty(&pagelist))
putback_movable_pages(&pagelist);
- pr_info("soft offline: %#lx: migration failed %d, type %lx (%pGp)\n",
- pfn, ret, page->flags, &page->flags);
+ pr_info("soft offline: %#lx: %s migration failed %d, type %lx (%pGp)\n",
+ pfn, msg_page[huge], ret, page->flags, &page->flags);
if (ret > 0)
ret = -EIO;
}
} else {
- pr_info("soft offline: %#lx: isolation failed: %d, page count %d, type %lx (%pGp)\n",
- pfn, ret, page_count(page), page->flags, &page->flags);
+ pr_info("soft offline: %#lx: %s isolation failed: %d, page count %d, type %lx (%pGp)\n",
+ pfn, msg_page[huge], ret, page_count(page), page->flags, &page->flags);
}
return ret;
}
static int soft_offline_in_use_page(struct page *page)
{
- int ret;
struct page *hpage = compound_head(page);
if (!PageHuge(page) && PageTransHuge(hpage))
if (try_to_split_thp_page(page, "soft offline") < 0)
return -EBUSY;
- if (PageHuge(page))
- ret = soft_offline_huge_page(page);
- else
- ret = __soft_offline_page(page);
- return ret;
+ return __soft_offline_page(page);
}
static int soft_offline_free_page(struct page *page)
_
Patches currently in -mm which might be from osalvador@suse.de are
mmmadvise-refactor-madvise_inject_error.patch
mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
mmhwpoison-kill-put_hwpoison_page.patch
mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
mmhwpoison-rework-soft-offline-for-free-pages.patch
mmhwpoison-rework-soft-offline-for-in-use-pages.patch
mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
mmhwpoison-introduce-mf_msg_unsplit_thp.patch
^ permalink raw reply
* Re: [PATCH v7 2/2] s390: virtio: PV needs VIRTIO I/O device protection
From: Michael S. Tsirkin @ 2020-07-16 21:46 UTC (permalink / raw)
To: Christian Borntraeger
Cc: Jason Wang, Pierre Morel, linux-kernel, pasic, frankja, cohuck,
kvm, linux-s390, virtualization, thomas.lendacky, david, linuxram,
hca, gor
In-Reply-To: <3782338a-6491-dc35-7c66-97b91a20df0d@de.ibm.com>
On Thu, Jul 16, 2020 at 01:19:55PM +0200, Christian Borntraeger wrote:
>
>
> On 15.07.20 13:51, Michael S. Tsirkin wrote:
> > On Wed, Jul 15, 2020 at 06:16:59PM +0800, Jason Wang wrote:
> >>
> >> On 2020/7/15 下午5:50, Michael S. Tsirkin wrote:
> >>> On Wed, Jul 15, 2020 at 10:31:09AM +0200, Pierre Morel wrote:
> >>>> If protected virtualization is active on s390, the virtio queues are
> >>>> not accessible to the host, unless VIRTIO_F_IOMMU_PLATFORM has been
> >>>> negotiated. Use the new arch_validate_virtio_features() interface to
> >>>> fail probe if that's not the case, preventing a host error on access
> >>>> attempt.
> >>>>
> >>>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> >>>> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> >>>> Acked-by: Halil Pasic <pasic@linux.ibm.com>
> >>>> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
> >>>> ---
> >>>> arch/s390/mm/init.c | 28 ++++++++++++++++++++++++++++
> >>>> 1 file changed, 28 insertions(+)
> >>>>
> >>>> diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
> >>>> index 6dc7c3b60ef6..d39af6554d4f 100644
> >>>> --- a/arch/s390/mm/init.c
> >>>> +++ b/arch/s390/mm/init.c
> >>>> @@ -45,6 +45,7 @@
> >>>> #include <asm/kasan.h>
> >>>> #include <asm/dma-mapping.h>
> >>>> #include <asm/uv.h>
> >>>> +#include <linux/virtio_config.h>
> >>>> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
> >>>> @@ -161,6 +162,33 @@ bool force_dma_unencrypted(struct device *dev)
> >>>> return is_prot_virt_guest();
> >>>> }
> >>>> +/*
> >>>> + * arch_validate_virtio_features
> >>>> + * @dev: the VIRTIO device being added
> >>>> + *
> >>>> + * Return an error if required features are missing on a guest running
> >>>> + * with protected virtualization.
> >>>> + */
> >>>> +int arch_validate_virtio_features(struct virtio_device *dev)
> >>>> +{
> >>>> + if (!is_prot_virt_guest())
> >>>> + return 0;
> >>>> +
> >>>> + if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) {
> >>>> + dev_warn(&dev->dev,
> >>>> + "legacy virtio not supported with protected virtualization\n");
> >>>> + return -ENODEV;
> >>>> + }
> >>>> +
> >>>> + if (!virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) {
> >>>> + dev_warn(&dev->dev,
> >>>> + "support for limited memory access required for protected virtualization\n");
> >>>> + return -ENODEV;
> >>>> + }
> >>>> +
> >>>> + return 0;
> >>>> +}
> >>>> +
> >>>> /* protected virtualization */
> >>>> static void pv_init(void)
> >>>> {
> >>> What bothers me here is that arch code depends on virtio now.
> >>> It works even with a modular virtio when functions are inline,
> >>> but it seems fragile: e.g. it breaks virtio as an out of tree module,
> >>> since layout of struct virtio_device can change.
> >>
>
> If you prefer that, we can simply create an arch/s390/kernel/virtio.c ?
How would that address the issues above?
^ permalink raw reply
* + mmhwpoison-rework-soft-offline-for-in-use-pages.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, osalvador,
tony.luck, zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: rework soft offline for in-use pages
has been added to the -mm tree. Its filename is
mmhwpoison-rework-soft-offline-for-in-use-pages.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-rework-soft-offline-for-in-use-pages.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-rework-soft-offline-for-in-use-pages.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Oscar Salvador <osalvador@suse.de>
Subject: mm,hwpoison: rework soft offline for in-use pages
This patch changes the way we set and handle in-use poisoned pages. Until
now, poisoned pages were released to the buddy allocator, trusting that
the checks that take place prior to deliver the page to its end user would
act as a safe net and would skip that page.
This has proved to be wrong, as we got some pfn walkers out there, like
compaction, that all they care is the page to be PageBuddy and be in a
freelist.
Although this might not be the only user, having poisoned pages in the
buddy allocator seems a bad idea as we should only have free pages that
are ready and meant to be used as such.
Before explaining the taken approach, let us break down the kind of pages
we can soft offline.
- Anonymous THP (after the split, they end up being 4K pages)
- Hugetlb
- Order-0 pages (that can be either migrated or invalited)
* Normal pages (order-0 and anon-THP)
- If they are clean and unmapped page cache pages, we invalidate
then by means of invalidate_inode_page().
- If they are mapped/dirty, we do the isolate-and-migrate dance.
Either way, do not call put_page directly from those paths.
Instead, we keep the page and send it to page_set_poison to perform the
right handling.
Among other things, page_set_poison() sets the HWPoison flag and does the last
put_page.
This call to put_page is mainly to be able to call __page_cache_release,
since this function is not exported.
Down the chain, we placed a check for HWPoison page in
free_pages_prepare, that just skips any poisoned page, so those pages
do not end up either in a pcplist or in buddy-freelist.
After that, we set the refcount on the page to 1 and we increment
the poisoned pages counter.
We could do as we do for free pages:
1) wait until the page hits buddy's freelists
2) take it off
3) flag it
The problem is that we could race with an allocation, so by the time we
want to take the page off the buddy, the page is already allocated, so we
cannot soft-offline it.
This is not fatal of course, but if it is better if we can close the race
as does not require a lot of code.
* Hugetlb pages
- We isolate-and-migrate them
There is no magic in here, we just isolate and migrate them.
A new set of internal functions have been made to flag a hugetlb page as
poisoned (SetPageHugePoisoned(), PageHugePoisoned(), ClearPageHugePoisoned())
This allows us to flag the page when we migrate it, back in
move_hugetlb_state().
Later on we check whether the page is poisoned in __free_huge_page,
and we bail out in that case before sending the page to e.g: active
free list.
This gives us full control of the page, and we can handle it
page_handle_poison().
In other words, we do not allow migrated hugepages to get back to the
freelists.
Since now the page has no user and has been migrated, we can call
dissolve_free_huge_page, which will end up calling update_and_free_page.
In update_and_free_page(), we check for the page to be poisoned.
If it so, we handle it as we handle gigantic pages, i.e: we break down
the page in order-0 pages and free them one by one.
Doing so, allows us for free_pages_prepare to skip poisoned pages.
Because of the way we handle now in-use pages, we no longer need the
put-as-isolation-migratetype dance, that was guarding for poisoned pages
to end up in pcplists.
Link: http://lkml.kernel.org/r/20200716123810.25292-13-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.com>
Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/page-flags.h | 5 --
mm/hugetlb.c | 60 ++++++++++++++++++++++++++++++-----
mm/memory-failure.c | 53 ++++++++++++------------------
mm/migrate.c | 11 +-----
mm/page_alloc.c | 38 +++++-----------------
5 files changed, 86 insertions(+), 81 deletions(-)
--- a/include/linux/page-flags.h~mmhwpoison-rework-soft-offline-for-in-use-pages
+++ a/include/linux/page-flags.h
@@ -423,13 +423,8 @@ PAGEFLAG(HWPoison, hwpoison, PF_ANY)
TESTSCFLAG(HWPoison, hwpoison, PF_ANY)
#define __PG_HWPOISON (1UL << PG_hwpoison)
extern bool take_page_off_buddy(struct page *page);
-extern bool set_hwpoison_free_buddy_page(struct page *page);
#else
PAGEFLAG_FALSE(HWPoison)
-static inline bool set_hwpoison_free_buddy_page(struct page *page)
-{
- return 0;
-}
#define __PG_HWPOISON 0
#endif
--- a/mm/hugetlb.c~mmhwpoison-rework-soft-offline-for-in-use-pages
+++ a/mm/hugetlb.c
@@ -29,6 +29,7 @@
#include <linux/numa.h>
#include <linux/llist.h>
#include <linux/cma.h>
+#include <linux/migrate.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
@@ -1210,9 +1211,26 @@ static int hstate_next_node_to_free(stru
((node = hstate_next_node_to_free(hs, mask)) || 1); \
nr_nodes--)
-#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
-static void destroy_compound_gigantic_page(struct page *page,
- unsigned int order)
+static inline bool PageHugePoisoned(struct page *page)
+{
+ if (!PageHuge(page))
+ return false;
+
+ return (unsigned long)page[3].mapping == -1U;
+}
+
+static inline void SetPageHugePoisoned(struct page *page)
+{
+ page[3].mapping = (void *)-1U;
+}
+
+static inline void ClearPageHugePoisoned(struct page *page)
+{
+ page[3].mapping = NULL;
+}
+
+static void destroy_compound_gigantic_page(struct hstate *h, struct page *page,
+ unsigned int order)
{
int i;
int nr_pages = 1 << order;
@@ -1223,14 +1241,19 @@ static void destroy_compound_gigantic_pa
atomic_set(compound_pincount_ptr(page), 0);
for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {
+ if (!hstate_is_gigantic(h))
+ p->mapping = NULL;
clear_compound_head(p);
set_page_refcounted(p);
}
+ if (PageHugePoisoned(page))
+ ClearPageHugePoisoned(page);
set_compound_order(page, 0);
__ClearPageHead(page);
}
+#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
static void free_gigantic_page(struct page *page, unsigned int order)
{
/*
@@ -1285,13 +1308,16 @@ static struct page *alloc_gigantic_page(
return NULL;
}
static inline void free_gigantic_page(struct page *page, unsigned int order) { }
-static inline void destroy_compound_gigantic_page(struct page *page,
- unsigned int order) { }
+static inline void destroy_compound_gigantic_page(struct hstate *h,
+ struct page *page,
+ unsigned int order) { }
#endif
static void update_and_free_page(struct hstate *h, struct page *page)
{
int i;
+ bool poisoned = PageHugePoisoned(page);
+ unsigned int order = huge_page_order(h);
if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
return;
@@ -1314,11 +1340,21 @@ static void update_and_free_page(struct
* we might block in free_gigantic_page().
*/
spin_unlock(&hugetlb_lock);
- destroy_compound_gigantic_page(page, huge_page_order(h));
- free_gigantic_page(page, huge_page_order(h));
+ destroy_compound_gigantic_page(h, page, order);
+ free_gigantic_page(page, order);
spin_lock(&hugetlb_lock);
} else {
- __free_pages(page, huge_page_order(h));
+ if (unlikely(poisoned)) {
+ /*
+ * If the hugepage is poisoned, do as we do for
+ * gigantic pages and free the pages as order-0.
+ * free_pages_prepare will skip over the poisoned ones.
+ */
+ destroy_compound_gigantic_page(h, page, order);
+ free_contig_range(page_to_pfn(page), 1 << order);
+ } else {
+ __free_pages(page, huge_page_order(h));
+ }
}
}
@@ -1428,6 +1464,11 @@ static void __free_huge_page(struct page
if (restore_reserve)
h->resv_huge_pages++;
+ if (PageHugePoisoned(page)) {
+ spin_unlock(&hugetlb_lock);
+ return;
+ }
+
if (PageHugeTemporary(page)) {
list_del(&page->lru);
ClearPageHugeTemporary(page);
@@ -5629,6 +5670,9 @@ void move_hugetlb_state(struct page *old
hugetlb_cgroup_migrate(oldpage, newpage);
set_page_owner_migrate_reason(newpage, reason);
+ if (reason == MR_MEMORY_FAILURE)
+ SetPageHugePoisoned(oldpage);
+
/*
* transfer temporary state of the new huge page. This is
* reverse to other transitions because the newpage is going to
--- a/mm/memory-failure.c~mmhwpoison-rework-soft-offline-for-in-use-pages
+++ a/mm/memory-failure.c
@@ -65,9 +65,17 @@ int sysctl_memory_failure_recovery __rea
atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0);
-static void page_handle_poison(struct page *page)
+static void page_handle_poison(struct page *page, bool release, bool set_flag,
+ bool huge_flag)
{
- SetPageHWPoison(page);
+ if (set_flag)
+ SetPageHWPoison(page);
+
+ if (huge_flag)
+ dissolve_free_huge_page(page);
+ else if (release)
+ put_page(page);
+
page_ref_inc(page);
num_poisoned_pages_inc();
}
@@ -1717,7 +1725,7 @@ static int get_any_page(struct page *pag
static int soft_offline_huge_page(struct page *page)
{
- int ret;
+ int ret = -EBUSY;
unsigned long pfn = page_to_pfn(page);
struct page *hpage = compound_head(page);
LIST_HEAD(pagelist);
@@ -1757,19 +1765,12 @@ static int soft_offline_huge_page(struct
ret = -EIO;
} else {
/*
- * We set PG_hwpoison only when the migration source hugepage
- * was successfully dissolved, because otherwise hwpoisoned
- * hugepage remains on free hugepage list, then userspace will
- * find it as SIGBUS by allocation failure. That's not expected
- * in soft-offlining.
+ * At this point the page cannot be in-use since we do not
+ * let the page to go back to hugetlb freelists.
+ * In that case we just need to dissolve it.
+ * page_handle_poison will take care of it.
*/
- ret = dissolve_free_huge_page(page);
- if (!ret) {
- if (set_hwpoison_free_buddy_page(page))
- num_poisoned_pages_inc();
- else
- ret = -EBUSY;
- }
+ page_handle_poison(page, true, true, true);
}
return ret;
}
@@ -1804,10 +1805,8 @@ static int __soft_offline_page(struct pa
* would need to fix isolation locking first.
*/
if (ret == 1) {
- put_page(page);
pr_info("soft_offline: %#lx: invalidated\n", pfn);
- SetPageHWPoison(page);
- num_poisoned_pages_inc();
+ page_handle_poison(page, true, true, false);
return 0;
}
@@ -1838,7 +1837,9 @@ static int __soft_offline_page(struct pa
list_add(&page->lru, &pagelist);
ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL,
MIGRATE_SYNC, MR_MEMORY_FAILURE);
- if (ret) {
+ if (!ret) {
+ page_handle_poison(page, true, true, false);
+ } else {
if (!list_empty(&pagelist))
putback_movable_pages(&pagelist);
@@ -1857,37 +1858,25 @@ static int __soft_offline_page(struct pa
static int soft_offline_in_use_page(struct page *page)
{
int ret;
- int mt;
struct page *hpage = compound_head(page);
if (!PageHuge(page) && PageTransHuge(hpage))
if (try_to_split_thp_page(page, "soft offline") < 0)
return -EBUSY;
- /*
- * Setting MIGRATE_ISOLATE here ensures that the page will be linked
- * to free list immediately (not via pcplist) when released after
- * successful page migration. Otherwise we can't guarantee that the
- * page is really free after put_page() returns, so
- * set_hwpoison_free_buddy_page() highly likely fails.
- */
- mt = get_pageblock_migratetype(page);
- set_pageblock_migratetype(page, MIGRATE_ISOLATE);
if (PageHuge(page))
ret = soft_offline_huge_page(page);
else
ret = __soft_offline_page(page);
- set_pageblock_migratetype(page, mt);
return ret;
}
static int soft_offline_free_page(struct page *page)
{
int rc = -EBUSY;
- int rc = dissolve_free_huge_page(page);
if (!dissolve_free_huge_page(page) && take_page_off_buddy(page)) {
- page_handle_poison(page);
+ page_handle_poison(page, false, true, false);
rc = 0;
}
--- a/mm/migrate.c~mmhwpoison-rework-soft-offline-for-in-use-pages
+++ a/mm/migrate.c
@@ -1222,16 +1222,11 @@ out:
* we want to retry.
*/
if (rc == MIGRATEPAGE_SUCCESS) {
- put_page(page);
- if (reason == MR_MEMORY_FAILURE) {
+ if (reason != MR_MEMORY_FAILURE)
/*
- * Set PG_HWPoison on just freed page
- * intentionally. Although it's rather weird,
- * it's how HWPoison flag works at the moment.
+ * We handle poisoned pages in page_handle_poison.
*/
- if (set_hwpoison_free_buddy_page(page))
- num_poisoned_pages_inc();
- }
+ put_page(page);
} else {
if (rc != -EAGAIN) {
if (likely(!__PageMovable(page))) {
--- a/mm/page_alloc.c~mmhwpoison-rework-soft-offline-for-in-use-pages
+++ a/mm/page_alloc.c
@@ -1175,6 +1175,16 @@ static __always_inline bool free_pages_p
trace_mm_page_free(page, order);
+ if (unlikely(PageHWPoison(page)) && !order) {
+ /*
+ * Untie memcg state and reset page's owner
+ */
+ if (memcg_kmem_enabled() && PageKmemcg(page))
+ __memcg_kmem_uncharge_page(page, order);
+ reset_page_owner(page, order);
+ return false;
+ }
+
/*
* Check tail pages before head page information is cleared to
* avoid checking PageCompound for order-0 pages.
@@ -8828,32 +8838,4 @@ bool take_page_off_buddy(struct page *pa
spin_unlock_irqrestore(&zone->lock, flags);
return ret;
}
-
-/*
- * Set PG_hwpoison flag if a given page is confirmed to be a free page. This
- * test is performed under the zone lock to prevent a race against page
- * allocation.
- */
-bool set_hwpoison_free_buddy_page(struct page *page)
-{
- struct zone *zone = page_zone(page);
- unsigned long pfn = page_to_pfn(page);
- unsigned long flags;
- unsigned int order;
- bool hwpoisoned = false;
-
- spin_lock_irqsave(&zone->lock, flags);
- for (order = 0; order < MAX_ORDER; order++) {
- struct page *page_head = page - (pfn & ((1 << order) - 1));
-
- if (PageBuddy(page_head) && page_order(page_head) >= order) {
- if (!TestSetPageHWPoison(page))
- hwpoisoned = true;
- break;
- }
- }
- spin_unlock_irqrestore(&zone->lock, flags);
-
- return hwpoisoned;
-}
#endif
_
Patches currently in -mm which might be from osalvador@suse.de are
mmmadvise-refactor-madvise_inject_error.patch
mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
mmhwpoison-kill-put_hwpoison_page.patch
mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
mmhwpoison-rework-soft-offline-for-free-pages.patch
mmhwpoison-rework-soft-offline-for-in-use-pages.patch
mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
mmhwpoison-introduce-mf_msg_unsplit_thp.patch
^ permalink raw reply
* + mmhwpoison-rework-soft-offline-for-free-pages.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, osalvador,
tony.luck, zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: rework soft offline for free pages
has been added to the -mm tree. Its filename is
mmhwpoison-rework-soft-offline-for-free-pages.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-rework-soft-offline-for-free-pages.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-rework-soft-offline-for-free-pages.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Oscar Salvador <osalvador@suse.de>
Subject: mm,hwpoison: rework soft offline for free pages
When trying to soft-offline a free page, we need to first take it off the
buddy allocator. Once we know is out of reach, we can safely flag it as
poisoned.
take_page_off_buddy will be used to take a page meant to be poisoned off
the buddy allocator. take_page_off_buddy calls break_down_buddy_pages,
which splits a higher-order page in case our page belongs to one.
Once the page is under our control, we call page_handle_poison to set it
as poisoned and grab a refcount on it.
Link: http://lkml.kernel.org/r/20200716123810.25292-12-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.com>
Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/page-flags.h | 1
mm/memory-failure.c | 17 ++++++--
mm/page_alloc.c | 68 +++++++++++++++++++++++++++++++++++
3 files changed, 81 insertions(+), 5 deletions(-)
--- a/include/linux/page-flags.h~mmhwpoison-rework-soft-offline-for-free-pages
+++ a/include/linux/page-flags.h
@@ -422,6 +422,7 @@ PAGEFLAG_FALSE(Uncached)
PAGEFLAG(HWPoison, hwpoison, PF_ANY)
TESTSCFLAG(HWPoison, hwpoison, PF_ANY)
#define __PG_HWPOISON (1UL << PG_hwpoison)
+extern bool take_page_off_buddy(struct page *page);
extern bool set_hwpoison_free_buddy_page(struct page *page);
#else
PAGEFLAG_FALSE(HWPoison)
--- a/mm/memory-failure.c~mmhwpoison-rework-soft-offline-for-free-pages
+++ a/mm/memory-failure.c
@@ -65,6 +65,13 @@ int sysctl_memory_failure_recovery __rea
atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0);
+static void page_handle_poison(struct page *page)
+{
+ SetPageHWPoison(page);
+ page_ref_inc(page);
+ num_poisoned_pages_inc();
+}
+
#if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
u32 hwpoison_filter_enable = 0;
@@ -1876,14 +1883,14 @@ static int soft_offline_in_use_page(stru
static int soft_offline_free_page(struct page *page)
{
+ int rc = -EBUSY;
int rc = dissolve_free_huge_page(page);
- if (!rc) {
- if (set_hwpoison_free_buddy_page(page))
- num_poisoned_pages_inc();
- else
- rc = -EBUSY;
+ if (!dissolve_free_huge_page(page) && take_page_off_buddy(page)) {
+ page_handle_poison(page);
+ rc = 0;
}
+
return rc;
}
--- a/mm/page_alloc.c~mmhwpoison-rework-soft-offline-for-free-pages
+++ a/mm/page_alloc.c
@@ -8762,6 +8762,74 @@ bool is_free_buddy_page(struct page *pag
#ifdef CONFIG_MEMORY_FAILURE
/*
+ * Break down a higher-order page in sub-pages, and keep our target out of
+ * buddy allocator.
+ */
+static void break_down_buddy_pages(struct zone *zone, struct page *page,
+ struct page *target, int low, int high,
+ int migratetype)
+{
+ unsigned long size = 1 << high;
+ struct page *current_buddy, *next_page;
+
+ while (high > low) {
+ high--;
+ size >>= 1;
+
+ if (target >= &page[size]) {
+ next_page = page + size;
+ current_buddy = page;
+ } else {
+ next_page = page;
+ current_buddy = page + size;
+ }
+
+ if (set_page_guard(zone, current_buddy, high, migratetype))
+ continue;
+
+ if (current_buddy != target) {
+ add_to_free_list(current_buddy, zone, high, migratetype);
+ set_page_order(current_buddy, high);
+ page = next_page;
+ }
+ }
+}
+
+/*
+ * Take a page that will be marked as poisoned off the buddy allocator.
+ */
+bool take_page_off_buddy(struct page *page)
+{
+ struct zone *zone = page_zone(page);
+ unsigned long pfn = page_to_pfn(page);
+ unsigned long flags;
+ unsigned int order;
+ bool ret = false;
+
+ spin_lock_irqsave(&zone->lock, flags);
+ for (order = 0; order < MAX_ORDER; order++) {
+ struct page *page_head = page - (pfn & ((1 << order) - 1));
+ int buddy_order = page_order(page_head);
+
+ if (PageBuddy(page_head) && buddy_order >= order) {
+ unsigned long pfn_head = page_to_pfn(page_head);
+ int migratetype = get_pfnblock_migratetype(page_head,
+ pfn_head);
+
+ del_page_from_free_list(page_head, zone, buddy_order);
+ break_down_buddy_pages(zone, page_head, page, 0,
+ buddy_order, migratetype);
+ ret = true;
+ break;
+ }
+ if (page_count(page_head) > 0)
+ break;
+ }
+ spin_unlock_irqrestore(&zone->lock, flags);
+ return ret;
+}
+
+/*
* Set PG_hwpoison flag if a given page is confirmed to be a free page. This
* test is performed under the zone lock to prevent a race against page
* allocation.
_
Patches currently in -mm which might be from osalvador@suse.de are
mmmadvise-refactor-madvise_inject_error.patch
mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
mmhwpoison-kill-put_hwpoison_page.patch
mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
mmhwpoison-rework-soft-offline-for-free-pages.patch
mmhwpoison-rework-soft-offline-for-in-use-pages.patch
mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
mmhwpoison-introduce-mf_msg_unsplit_thp.patch
^ permalink raw reply
* + mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, osalvador,
tony.luck, zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: Unify THP handling for hard and soft offline
has been added to the -mm tree. Its filename is
mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Oscar Salvador <osalvador@suse.de>
Subject: mm,hwpoison: Unify THP handling for hard and soft offline
Place the THP's page handling in a helper and use it from both hard and
soft-offline machinery, so we get rid of some duplicated code.
Link: http://lkml.kernel.org/r/20200716123810.25292-11-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.com>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memory-failure.c | 48 +++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 26 deletions(-)
--- a/mm/memory-failure.c~mmhwpoison-unify-thp-handling-for-hard-and-soft-offline
+++ a/mm/memory-failure.c
@@ -1103,6 +1103,25 @@ static int identify_page_state(unsigned
return page_action(ps, p, pfn);
}
+static int try_to_split_thp_page(struct page *page, const char *msg)
+{
+ lock_page(page);
+ if (!PageAnon(page) || unlikely(split_huge_page(page))) {
+ unsigned long pfn = page_to_pfn(page);
+
+ unlock_page(page);
+ if (!PageAnon(page))
+ pr_info("%s: %#lx: non anonymous thp\n", msg, pfn);
+ else
+ pr_info("%s: %#lx: thp split failed\n", msg, pfn);
+ put_page(page);
+ return -EBUSY;
+ }
+ unlock_page(page);
+
+ return 0;
+}
+
static int memory_failure_hugetlb(unsigned long pfn, int flags)
{
struct page *p = pfn_to_page(pfn);
@@ -1325,21 +1344,8 @@ int memory_failure(unsigned long pfn, in
}
if (PageTransHuge(hpage)) {
- lock_page(p);
- if (!PageAnon(p) || unlikely(split_huge_page(p))) {
- unlock_page(p);
- if (!PageAnon(p))
- pr_err("Memory failure: %#lx: non anonymous thp\n",
- pfn);
- else
- pr_err("Memory failure: %#lx: thp split failed\n",
- pfn);
- if (TestClearPageHWPoison(p))
- num_poisoned_pages_dec();
- put_page(p);
+ if (try_to_split_thp_page(p, "Memory Failure") < 0)
return -EBUSY;
- }
- unlock_page(p);
VM_BUG_ON_PAGE(!page_count(p), p);
}
@@ -1847,19 +1853,9 @@ static int soft_offline_in_use_page(stru
int mt;
struct page *hpage = compound_head(page);
- if (!PageHuge(page) && PageTransHuge(hpage)) {
- lock_page(page);
- if (!PageAnon(page) || unlikely(split_huge_page(page))) {
- unlock_page(page);
- if (!PageAnon(page))
- pr_info("soft offline: %#lx: non anonymous thp\n", page_to_pfn(page));
- else
- pr_info("soft offline: %#lx: thp split failed\n", page_to_pfn(page));
- put_page(page);
+ if (!PageHuge(page) && PageTransHuge(hpage))
+ if (try_to_split_thp_page(page, "soft offline") < 0)
return -EBUSY;
- }
- unlock_page(page);
- }
/*
* Setting MIGRATE_ISOLATE here ensures that the page will be linked
_
Patches currently in -mm which might be from osalvador@suse.de are
mmmadvise-refactor-madvise_inject_error.patch
mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
mmhwpoison-kill-put_hwpoison_page.patch
mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
mmhwpoison-rework-soft-offline-for-free-pages.patch
mmhwpoison-rework-soft-offline-for-in-use-pages.patch
mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
mmhwpoison-introduce-mf_msg_unsplit_thp.patch
^ permalink raw reply
* + mmhwpoison-remove-flag-argument-from-soft-offline-functions.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, tony.luck,
zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: remove flag argument from soft offline functions
has been added to the -mm tree. Its filename is
mmhwpoison-remove-flag-argument-from-soft-offline-functions.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-remove-flag-argument-from-soft-offline-functions.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-remove-flag-argument-from-soft-offline-functions.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Subject: mm,hwpoison: remove flag argument from soft offline functions
The argument @flag no longer affects the behavior of soft_offline_page()
and its variants, so let's remove them.
Link: http://lkml.kernel.org/r/20200716123810.25292-10-osalvador@suse.de
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Oscar Salvador <osalvador@suse.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/base/memory.c | 2 +-
include/linux/mm.h | 2 +-
mm/madvise.c | 2 +-
mm/memory-failure.c | 27 +++++++++++++--------------
4 files changed, 16 insertions(+), 17 deletions(-)
--- a/drivers/base/memory.c~mmhwpoison-remove-flag-argument-from-soft-offline-functions
+++ a/drivers/base/memory.c
@@ -463,7 +463,7 @@ static ssize_t soft_offline_page_store(s
if (kstrtoull(buf, 0, &pfn) < 0)
return -EINVAL;
pfn >>= PAGE_SHIFT;
- ret = soft_offline_page(pfn, 0);
+ ret = soft_offline_page(pfn);
return ret == 0 ? count : ret;
}
--- a/include/linux/mm.h~mmhwpoison-remove-flag-argument-from-soft-offline-functions
+++ a/include/linux/mm.h
@@ -2995,7 +2995,7 @@ extern int sysctl_memory_failure_early_k
extern int sysctl_memory_failure_recovery;
extern void shake_page(struct page *p, int access);
extern atomic_long_t num_poisoned_pages __read_mostly;
-extern int soft_offline_page(unsigned long pfn, int flags);
+extern int soft_offline_page(unsigned long pfn);
/*
--- a/mm/madvise.c~mmhwpoison-remove-flag-argument-from-soft-offline-functions
+++ a/mm/madvise.c
@@ -910,7 +910,7 @@ static int madvise_inject_error(int beha
pr_info("Soft offlining pfn %#lx at process virtual address %#lx\n",
pfn, start);
- ret = soft_offline_page(pfn, 0);
+ ret = soft_offline_page(pfn);
} else {
pr_info("Injecting memory failure for pfn %#lx at process virtual address %#lx\n",
pfn, start);
--- a/mm/memory-failure.c~mmhwpoison-remove-flag-argument-from-soft-offline-functions
+++ a/mm/memory-failure.c
@@ -1502,7 +1502,7 @@ static void memory_failure_work_func(str
if (!gotten)
break;
if (entry.flags & MF_SOFT_OFFLINE)
- soft_offline_page(entry.pfn, entry.flags);
+ soft_offline_page(entry.pfn);
else
memory_failure(entry.pfn, entry.flags);
}
@@ -1648,7 +1648,7 @@ static struct page *new_page(struct page
* that is not free, and 1 for any other page type.
* For 1 the page is returned with increased page count, otherwise not.
*/
-static int __get_any_page(struct page *p, unsigned long pfn, int flags)
+static int __get_any_page(struct page *p, unsigned long pfn)
{
int ret;
@@ -1675,9 +1675,9 @@ static int __get_any_page(struct page *p
return ret;
}
-static int get_any_page(struct page *page, unsigned long pfn, int flags)
+static int get_any_page(struct page *page, unsigned long pfn)
{
- int ret = __get_any_page(page, pfn, flags);
+ int ret = __get_any_page(page, pfn);
if (ret == 1 && !PageHuge(page) &&
!PageLRU(page) && !__PageMovable(page)) {
@@ -1690,7 +1690,7 @@ static int get_any_page(struct page *pag
/*
* Did it turn free?
*/
- ret = __get_any_page(page, pfn, 0);
+ ret = __get_any_page(page, pfn);
if (ret == 1 && !PageLRU(page)) {
/* Drop page reference which is from __get_any_page() */
put_page(page);
@@ -1702,7 +1702,7 @@ static int get_any_page(struct page *pag
return ret;
}
-static int soft_offline_huge_page(struct page *page, int flags)
+static int soft_offline_huge_page(struct page *page)
{
int ret;
unsigned long pfn = page_to_pfn(page);
@@ -1761,7 +1761,7 @@ static int soft_offline_huge_page(struct
return ret;
}
-static int __soft_offline_page(struct page *page, int flags)
+static int __soft_offline_page(struct page *page)
{
int ret;
unsigned long pfn = page_to_pfn(page);
@@ -1841,7 +1841,7 @@ static int __soft_offline_page(struct pa
return ret;
}
-static int soft_offline_in_use_page(struct page *page, int flags)
+static int soft_offline_in_use_page(struct page *page)
{
int ret;
int mt;
@@ -1871,9 +1871,9 @@ static int soft_offline_in_use_page(stru
mt = get_pageblock_migratetype(page);
set_pageblock_migratetype(page, MIGRATE_ISOLATE);
if (PageHuge(page))
- ret = soft_offline_huge_page(page, flags);
+ ret = soft_offline_huge_page(page);
else
- ret = __soft_offline_page(page, flags);
+ ret = __soft_offline_page(page);
set_pageblock_migratetype(page, mt);
return ret;
}
@@ -1894,7 +1894,6 @@ static int soft_offline_free_page(struct
/**
* soft_offline_page - Soft offline a page.
* @pfn: pfn to soft-offline
- * @flags: flags. Same as memory_failure().
*
* Returns 0 on success, otherwise negated errno.
*
@@ -1913,7 +1912,7 @@ static int soft_offline_free_page(struct
* This is not a 100% solution for all memory, but tries to be
* ``good enough'' for the majority of memory.
*/
-int soft_offline_page(unsigned long pfn, int flags)
+int soft_offline_page(unsigned long pfn)
{
int ret;
struct page *page;
@@ -1931,11 +1930,11 @@ int soft_offline_page(unsigned long pfn,
}
get_online_mems();
- ret = get_any_page(page, pfn, flags);
+ ret = get_any_page(page, pfn);
put_online_mems();
if (ret > 0)
- ret = soft_offline_in_use_page(page, flags);
+ ret = soft_offline_in_use_page(page);
else if (ret == 0)
ret = soft_offline_free_page(page);
_
Patches currently in -mm which might be from n-horiguchi@ah.jp.nec.com are
mmhwpoison-cleanup-unused-pagehuge-check.patch
mmmadvise-call-soft_offline_page-without-mf_count_increased.patch
mmhwpoison-inject-dont-pin-for-hwpoison_filter.patch
mmhwpoison-remove-mf_count_increased.patch
mmhwpoison-remove-flag-argument-from-soft-offline-functions.patch
^ permalink raw reply
* + mmhwpoison-remove-mf_count_increased.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, tony.luck,
zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: remove MF_COUNT_INCREASED
has been added to the -mm tree. Its filename is
mmhwpoison-remove-mf_count_increased.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-remove-mf_count_increased.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-remove-mf_count_increased.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Subject: mm,hwpoison: remove MF_COUNT_INCREASED
Now there's no user of MF_COUNT_INCREASED, so we can safely remove it from
all calling points.
Link: http://lkml.kernel.org/r/20200716123810.25292-9-osalvador@suse.de
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Oscar Salvador <osalvador@suse.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/mm.h | 7 +++----
mm/memory-failure.c | 14 +++-----------
2 files changed, 6 insertions(+), 15 deletions(-)
--- a/include/linux/mm.h~mmhwpoison-remove-mf_count_increased
+++ a/include/linux/mm.h
@@ -2983,10 +2983,9 @@ void register_page_bootmem_memmap(unsign
unsigned long nr_pages);
enum mf_flags {
- MF_COUNT_INCREASED = 1 << 0,
- MF_ACTION_REQUIRED = 1 << 1,
- MF_MUST_KILL = 1 << 2,
- MF_SOFT_OFFLINE = 1 << 3,
+ MF_ACTION_REQUIRED = 1 << 0,
+ MF_MUST_KILL = 1 << 1,
+ MF_SOFT_OFFLINE = 1 << 2,
};
extern int memory_failure(unsigned long pfn, int flags);
extern void memory_failure_queue(unsigned long pfn, int flags);
--- a/mm/memory-failure.c~mmhwpoison-remove-mf_count_increased
+++ a/mm/memory-failure.c
@@ -1118,7 +1118,7 @@ static int memory_failure_hugetlb(unsign
num_poisoned_pages_inc();
- if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p)) {
+ if (!get_hwpoison_page(p)) {
/*
* Check "filter hit" and "race with other subpage."
*/
@@ -1314,7 +1314,7 @@ int memory_failure(unsigned long pfn, in
* In fact it's dangerous to directly bump up page count from 0,
* that may make page_ref_freeze()/page_ref_unfreeze() mismatch.
*/
- if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p)) {
+ if (!get_hwpoison_page(p)) {
if (is_free_buddy_page(p)) {
action_result(pfn, MF_MSG_BUDDY, MF_DELAYED);
return 0;
@@ -1354,10 +1354,7 @@ int memory_failure(unsigned long pfn, in
shake_page(p, 0);
/* shake_page could have turned it free. */
if (!PageLRU(p) && is_free_buddy_page(p)) {
- if (flags & MF_COUNT_INCREASED)
- action_result(pfn, MF_MSG_BUDDY, MF_DELAYED);
- else
- action_result(pfn, MF_MSG_BUDDY_2ND, MF_DELAYED);
+ action_result(pfn, MF_MSG_BUDDY_2ND, MF_DELAYED);
return 0;
}
@@ -1655,9 +1652,6 @@ static int __get_any_page(struct page *p
{
int ret;
- if (flags & MF_COUNT_INCREASED)
- return 1;
-
/*
* When the target page is a free hugepage, just remove it
* from free hugepage list.
@@ -1933,8 +1927,6 @@ int soft_offline_page(unsigned long pfn,
if (PageHWPoison(page)) {
pr_info("soft offline: %#lx page already poisoned\n", pfn);
- if (flags & MF_COUNT_INCREASED)
- put_page(page);
return -EBUSY;
}
_
Patches currently in -mm which might be from n-horiguchi@ah.jp.nec.com are
mmhwpoison-cleanup-unused-pagehuge-check.patch
mmmadvise-call-soft_offline_page-without-mf_count_increased.patch
mmhwpoison-inject-dont-pin-for-hwpoison_filter.patch
mmhwpoison-remove-mf_count_increased.patch
mmhwpoison-remove-flag-argument-from-soft-offline-functions.patch
^ permalink raw reply
* + mmhwpoison-kill-put_hwpoison_page.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, osalvador,
tony.luck, zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: kill put_hwpoison_page
has been added to the -mm tree. Its filename is
mmhwpoison-kill-put_hwpoison_page.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-kill-put_hwpoison_page.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-kill-put_hwpoison_page.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Oscar Salvador <osalvador@suse.de>
Subject: mm,hwpoison: kill put_hwpoison_page
After commit 4e41a30c6d50 ("mm: hwpoison: adjust for new thp refcounting"),
put_hwpoison_page got reduced to a put_page.
Let us just use put_page instead.
Link: http://lkml.kernel.org/r/20200716123810.25292-8-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/mm.h | 1 -
mm/memory-failure.c | 30 +++++++++++++++---------------
2 files changed, 15 insertions(+), 16 deletions(-)
--- a/include/linux/mm.h~mmhwpoison-kill-put_hwpoison_page
+++ a/include/linux/mm.h
@@ -2992,7 +2992,6 @@ extern int memory_failure(unsigned long
extern void memory_failure_queue(unsigned long pfn, int flags);
extern void memory_failure_queue_kick(int cpu);
extern int unpoison_memory(unsigned long pfn);
-#define put_hwpoison_page(page) put_page(page)
extern int sysctl_memory_failure_early_kill;
extern int sysctl_memory_failure_recovery;
extern void shake_page(struct page *p, int access);
--- a/mm/memory-failure.c~mmhwpoison-kill-put_hwpoison_page
+++ a/mm/memory-failure.c
@@ -1144,7 +1144,7 @@ static int memory_failure_hugetlb(unsign
pr_err("Memory failure: %#lx: just unpoisoned\n", pfn);
num_poisoned_pages_dec();
unlock_page(head);
- put_hwpoison_page(head);
+ put_page(head);
return 0;
}
@@ -1336,7 +1336,7 @@ int memory_failure(unsigned long pfn, in
pfn);
if (TestClearPageHWPoison(p))
num_poisoned_pages_dec();
- put_hwpoison_page(p);
+ put_page(p);
return -EBUSY;
}
unlock_page(p);
@@ -1389,14 +1389,14 @@ int memory_failure(unsigned long pfn, in
pr_err("Memory failure: %#lx: just unpoisoned\n", pfn);
num_poisoned_pages_dec();
unlock_page(p);
- put_hwpoison_page(p);
+ put_page(p);
return 0;
}
if (hwpoison_filter(p)) {
if (TestClearPageHWPoison(p))
num_poisoned_pages_dec();
unlock_page(p);
- put_hwpoison_page(p);
+ put_page(p);
return 0;
}
@@ -1630,9 +1630,9 @@ int unpoison_memory(unsigned long pfn)
}
unlock_page(page);
- put_hwpoison_page(page);
+ put_page(page);
if (freeit && !(pfn == my_zero_pfn(0) && page_count(p) == 1))
- put_hwpoison_page(page);
+ put_page(page);
return 0;
}
@@ -1690,7 +1690,7 @@ static int get_any_page(struct page *pag
/*
* Try to free it.
*/
- put_hwpoison_page(page);
+ put_page(page);
shake_page(page, 1);
/*
@@ -1699,7 +1699,7 @@ static int get_any_page(struct page *pag
ret = __get_any_page(page, pfn, 0);
if (ret == 1 && !PageLRU(page)) {
/* Drop page reference which is from __get_any_page() */
- put_hwpoison_page(page);
+ put_page(page);
pr_info("soft_offline: %#lx: unknown non LRU page type %lx (%pGp)\n",
pfn, page->flags, &page->flags);
return -EIO;
@@ -1722,7 +1722,7 @@ static int soft_offline_huge_page(struct
lock_page(hpage);
if (PageHWPoison(hpage)) {
unlock_page(hpage);
- put_hwpoison_page(hpage);
+ put_page(hpage);
pr_info("soft offline: %#lx hugepage already poisoned\n", pfn);
return -EBUSY;
}
@@ -1733,7 +1733,7 @@ static int soft_offline_huge_page(struct
* get_any_page() and isolate_huge_page() takes a refcount each,
* so need to drop one here.
*/
- put_hwpoison_page(hpage);
+ put_page(hpage);
if (!ret) {
pr_info("soft offline: %#lx hugepage failed to isolate\n", pfn);
return -EBUSY;
@@ -1782,7 +1782,7 @@ static int __soft_offline_page(struct pa
wait_on_page_writeback(page);
if (PageHWPoison(page)) {
unlock_page(page);
- put_hwpoison_page(page);
+ put_page(page);
pr_info("soft offline: %#lx page already poisoned\n", pfn);
return -EBUSY;
}
@@ -1797,7 +1797,7 @@ static int __soft_offline_page(struct pa
* would need to fix isolation locking first.
*/
if (ret == 1) {
- put_hwpoison_page(page);
+ put_page(page);
pr_info("soft_offline: %#lx: invalidated\n", pfn);
SetPageHWPoison(page);
num_poisoned_pages_inc();
@@ -1817,7 +1817,7 @@ static int __soft_offline_page(struct pa
* Drop page reference which is came from get_any_page()
* successful isolate_lru_page() already took another one.
*/
- put_hwpoison_page(page);
+ put_page(page);
if (!ret) {
LIST_HEAD(pagelist);
/*
@@ -1861,7 +1861,7 @@ static int soft_offline_in_use_page(stru
pr_info("soft offline: %#lx: non anonymous thp\n", page_to_pfn(page));
else
pr_info("soft offline: %#lx: thp split failed\n", page_to_pfn(page));
- put_hwpoison_page(page);
+ put_page(page);
return -EBUSY;
}
unlock_page(page);
@@ -1934,7 +1934,7 @@ int soft_offline_page(unsigned long pfn,
if (PageHWPoison(page)) {
pr_info("soft offline: %#lx page already poisoned\n", pfn);
if (flags & MF_COUNT_INCREASED)
- put_hwpoison_page(page);
+ put_page(page);
return -EBUSY;
}
_
Patches currently in -mm which might be from osalvador@suse.de are
mmmadvise-refactor-madvise_inject_error.patch
mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
mmhwpoison-kill-put_hwpoison_page.patch
mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
mmhwpoison-rework-soft-offline-for-free-pages.patch
mmhwpoison-rework-soft-offline-for-in-use-pages.patch
mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
mmhwpoison-introduce-mf_msg_unsplit_thp.patch
^ permalink raw reply
* Re: [dpdk-dev] [PATCH v8 2/3] devtools: prevent use of rte atomic APIs in future patches
From: Stephen Hemminger @ 2020-07-16 21:45 UTC (permalink / raw)
To: Honnappa Nagarahalli
Cc: thomas@monjalon.net, Phil Yang, dev@dpdk.org, Mcnamara, John,
David Christensen, jerinj@marvell.com, Ananyev, Konstantin,
Ola Liljedahl, Bruce Richardson, Ruifeng Wang, nd, David Marchand
In-Reply-To: <DB6PR0802MB2216E14488C3DF27CDE9733D987F0@DB6PR0802MB2216.eurprd08.prod.outlook.com>
On Thu, 16 Jul 2020 16:59:11 +0000
Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com> wrote:
> <snip>
>
> > >
> > > > Subject: Re: [dpdk-dev] [PATCH v8 2/3] devtools: prevent use of rte
> > > > atomic APIs in future patches
> > > >
> > > > 16/07/2020 12:48, David Marchand:
> > > > > On Thu, Jul 16, 2020 at 6:58 AM Phil Yang <phil.yang@arm.com> wrote:
> > > > > > check_forbidden_additions() { # <patch>
> > > > > > res=0
> > > > > > + c11_atomics_dir="lib/librte_distributor lib/librte_hash
> > lib/librte_kni
> > > > > > + lib/librte_lpm lib/librte_rcu lib/librte_ring
> > > > > > + lib/librte_stack lib/librte_vhost
> > > > > > + drivers/event/octeontx drivers/event/octeontx2
> > > > > > + drivers/event/opdl drivers/net/bnx2x drivers/net/hinic
> > > > > > + drivers/net/hns3 drivers/net/memif
> > drivers/net/thunderx
> > > > > > + drivers/net/virtio examples/l2fwd-event"
> > > > >
> > > > > I prefer a form like:
> > > > >
> > > > > + c11_atomics_dir=""
> > > > > + c11_atomics_dir="$c11_atomics_dir drivers/event/octeontx"
> > > > > + c11_atomics_dir="$c11_atomics_dir drivers/event/octeontx2"
> > > > > + c11_atomics_dir="$c11_atomics_dir drivers/event/opdl"
> > > > > + c11_atomics_dir="$c11_atomics_dir drivers/net/bnx2x"
> > > > > + c11_atomics_dir="$c11_atomics_dir drivers/net/hinic"
> > > > > + c11_atomics_dir="$c11_atomics_dir drivers/net/hns3"
> > > > > + c11_atomics_dir="$c11_atomics_dir drivers/net/memif"
> > > > > + c11_atomics_dir="$c11_atomics_dir drivers/net/thunderx"
> > > > > + c11_atomics_dir="$c11_atomics_dir drivers/net/virtio"
> > > > > + c11_atomics_dir="$c11_atomics_dir examples/l2fwd-event"
> > > > > + c11_atomics_dir="$c11_atomics_dir lib/librte_distributor"
> > > > > + c11_atomics_dir="$c11_atomics_dir lib/librte_hash"
> > > > > + c11_atomics_dir="$c11_atomics_dir lib/librte_kni"
> > > > > + c11_atomics_dir="$c11_atomics_dir lib/librte_lpm"
> > > > > + c11_atomics_dir="$c11_atomics_dir lib/librte_rcu"
> > > > > + c11_atomics_dir="$c11_atomics_dir lib/librte_ring"
> > > > > + c11_atomics_dir="$c11_atomics_dir lib/librte_stack"
> > > > > + c11_atomics_dir="$c11_atomics_dir lib/librte_vhost"
> > > > >
> > > > > Easier to read and update.
> > > >
> > > > Why do we need this list at all?
> > > > Are we allowed to add new code with old atomics in other
> > > > directories?
> > > > How bad it is to have a warning on non-converted libs?
> > >
> > > From my perspective, the pros of this list are :
> > > 1. Avoid introducing false warnings in non-converted modules. Otherwise,
> > the maintainers have to wonder if that module is converted or not.
> >
> > Don't we want to convert all libs?
> The goal is to convert all the libs.
>
> > If we are adding one more rte_atomic in a lib, we should ask the question
> > why not converting to C11, no?
> Agree, I am fine with this approach. That will kind of distribute the conversion work as well.
>
> >
> > > 2. Keep non-converted modules compatible. C11 atomic builtins cannot be
> > used directly for rte_atomicXX_t variables.
> > >
> > > The cons are :
> > > 1. The list needs updating every time we convert a module.
> This list will go away once all the modules are converted.
>
> > > 2. The script is not elegant as before.
> >
> >
>
Can't the conversion just be automated with something coccinelle?
^ permalink raw reply
* + mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch added to -mm tree
From: Andrew Morton @ 2020-07-16 21:46 UTC (permalink / raw)
To: aneesh.kumar, dave.hansen, david, mhocko, mike.kravetz,
mm-commits, n-horiguchi, naoya.horiguchi, osalvador, osalvador,
tony.luck, zeil
In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org>
The patch titled
Subject: mm,hwpoison: Un-export get_hwpoison_page and make it static
has been added to the -mm tree. Its filename is
mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Oscar Salvador <osalvador@suse.de>
Subject: mm,hwpoison: Un-export get_hwpoison_page and make it static
Since get_hwpoison_page is only used in memory-failure code now,
let us un-export it and make it private to that code.
Link: http://lkml.kernel.org/r/20200716123810.25292-7-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/mm.h | 1 -
mm/memory-failure.c | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
--- a/include/linux/mm.h~mmhwpoison-un-export-get_hwpoison_page-and-make-it-static
+++ a/include/linux/mm.h
@@ -2992,7 +2992,6 @@ extern int memory_failure(unsigned long
extern void memory_failure_queue(unsigned long pfn, int flags);
extern void memory_failure_queue_kick(int cpu);
extern int unpoison_memory(unsigned long pfn);
-extern int get_hwpoison_page(struct page *page);
#define put_hwpoison_page(page) put_page(page)
extern int sysctl_memory_failure_early_kill;
extern int sysctl_memory_failure_recovery;
--- a/mm/memory-failure.c~mmhwpoison-un-export-get_hwpoison_page-and-make-it-static
+++ a/mm/memory-failure.c
@@ -925,7 +925,7 @@ static int page_action(struct page_state
* Return: return 0 if failed to grab the refcount, otherwise true (some
* non-zero value.)
*/
-int get_hwpoison_page(struct page *page)
+static int get_hwpoison_page(struct page *page)
{
struct page *head = compound_head(page);
@@ -954,7 +954,6 @@ int get_hwpoison_page(struct page *page)
return 0;
}
-EXPORT_SYMBOL_GPL(get_hwpoison_page);
/*
* Do all that is necessary to remove user space mappings. Unmap
_
Patches currently in -mm which might be from osalvador@suse.de are
mmmadvise-refactor-madvise_inject_error.patch
mmhwpoison-un-export-get_hwpoison_page-and-make-it-static.patch
mmhwpoison-kill-put_hwpoison_page.patch
mmhwpoison-unify-thp-handling-for-hard-and-soft-offline.patch
mmhwpoison-rework-soft-offline-for-free-pages.patch
mmhwpoison-rework-soft-offline-for-in-use-pages.patch
mmhwpoison-refactor-soft_offline_huge_page-and-__soft_offline_page.patch
mmhwpoison-return-0-if-the-page-is-already-poisoned-in-soft-offline.patch
mmhwpoison-introduce-mf_msg_unsplit_thp.patch
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
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.