2023-03-21 02:21:01

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the sysctl tree with Linus' tree

Hi all,

Today's linux-next merge of the sysctl tree got a conflict in:

mm/memory-failure.c

between commit:

44b8f8bf2438 ("mm: memory-failure: add memory failure stats to sysfs")

from Linus' tree and commit:

cfe7e6ea5ee2 ("mm: memory-failure: Move memory failure sysctls to its own file")

from the sysctl tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.



--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (488.00 B)
OpenPGP digital signature

2023-03-21 02:22:37

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: manual merge of the sysctl tree with Linus' tree

Hi all,

On Tue, 21 Mar 2023 13:20:52 +1100 Stephen Rothwell <[email protected]> wrote:
>
> Today's linux-next merge of the sysctl tree got a conflict in:
>
> mm/memory-failure.c
>
> between commit:
>
> 44b8f8bf2438 ("mm: memory-failure: add memory failure stats to sysfs")
>
> from Linus' tree and commit:
>
> cfe7e6ea5ee2 ("mm: memory-failure: Move memory failure sysctls to its own file")
>
> from the sysctl tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Sorry, I forgot the resolution - see below.
--
Cheers,
Stephen Rothwell

diff --cc mm/memory-failure.c
index f761704d27d7,242b6cae0035..000000000000
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@@ -87,41 -88,36 +88,71 @@@ inline void num_poisoned_pages_sub(unsi
memblk_nr_poison_sub(pfn, i);
}

+/**
+ * MF_ATTR_RO - Create sysfs entry for each memory failure statistics.
+ * @_name: name of the file in the per NUMA sysfs directory.
+ */
+#define MF_ATTR_RO(_name) \
+static ssize_t _name##_show(struct device *dev, \
+ struct device_attribute *attr, \
+ char *buf) \
+{ \
+ struct memory_failure_stats *mf_stats = \
+ &NODE_DATA(dev->id)->mf_stats; \
+ return sprintf(buf, "%lu\n", mf_stats->_name); \
+} \
+static DEVICE_ATTR_RO(_name)
+
+MF_ATTR_RO(total);
+MF_ATTR_RO(ignored);
+MF_ATTR_RO(failed);
+MF_ATTR_RO(delayed);
+MF_ATTR_RO(recovered);
+
+static struct attribute *memory_failure_attr[] = {
+ &dev_attr_total.attr,
+ &dev_attr_ignored.attr,
+ &dev_attr_failed.attr,
+ &dev_attr_delayed.attr,
+ &dev_attr_recovered.attr,
+ NULL,
+};
+
+const struct attribute_group memory_failure_attr_group = {
+ .name = "memory_failure",
+ .attrs = memory_failure_attr,
+};
+
+ #ifdef CONFIG_SYSCTL
+ static struct ctl_table memory_failure_table[] = {
+ {
+ .procname = "memory_failure_early_kill",
+ .data = &sysctl_memory_failure_early_kill,
+ .maxlen = sizeof(sysctl_memory_failure_early_kill),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE,
+ },
+ {
+ .procname = "memory_failure_recovery",
+ .data = &sysctl_memory_failure_recovery,
+ .maxlen = sizeof(sysctl_memory_failure_recovery),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE,
+ },
+ };
+
+ static int __init memory_failure_sysctl_init(void)
+ {
+ register_sysctl_init("vm", memory_failure_table);
+ return 0;
+ }
+ late_initcall(memory_failure_sysctl_init);
+ #endif /* CONFIG_SYSCTL */
+
/*
* Return values:
* 1: the page is dissolved (if needed) and taken off from buddy,


Attachments:
(No filename) (488.00 B)
OpenPGP digital signature

2023-03-21 05:41:15

by Luis Chamberlain

[permalink] [raw]
Subject: Re: linux-next: manual merge of the sysctl tree with Linus' tree

On Tue, Mar 21, 2023 at 01:22:27PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> On Tue, 21 Mar 2023 13:20:52 +1100 Stephen Rothwell <[email protected]> wrote:
> >
> > Today's linux-next merge of the sysctl tree got a conflict in:
> >
> > mm/memory-failure.c
> >
> > between commit:
> >
> > 44b8f8bf2438 ("mm: memory-failure: add memory failure stats to sysfs")
> >
> > from Linus' tree and commit:
> >
> > cfe7e6ea5ee2 ("mm: memory-failure: Move memory failure sysctls to its own file")
> >
> > from the sysctl tree.
> >
> > I fixed it up (see below) and can carry the fix as necessary. This
> > is now fixed as far as linux-next is concerned, but any non trivial
> > conflicts should be mentioned to your upstream maintainer when your tree
> > is submitted for merging. You may also want to consider cooperating
> > with the maintainer of the conflicting tree to minimise any particularly
> > complex conflicts.
>
> Sorry, I forgot the resolution - see below.

Oh sorry, its on Linus' tree, so I can just rebase too. Did that and
addressed the conflict as you did, thanks!

Luis

2023-03-21 14:43:00

by Jiaqi Yan

[permalink] [raw]
Subject: Re: linux-next: manual merge of the sysctl tree with Linus' tree

On Mon, Mar 20, 2023 at 10:41 PM Luis Chamberlain <[email protected]> wrote:
>
> On Tue, Mar 21, 2023 at 01:22:27PM +1100, Stephen Rothwell wrote:
> > Hi all,
> >
> > On Tue, 21 Mar 2023 13:20:52 +1100 Stephen Rothwell <[email protected]> wrote:
> > >
> > > Today's linux-next merge of the sysctl tree got a conflict in:
> > >
> > > mm/memory-failure.c
> > >
> > > between commit:
> > >
> > > 44b8f8bf2438 ("mm: memory-failure: add memory failure stats to sysfs")
> > >
> > > from Linus' tree and commit:
> > >
> > > cfe7e6ea5ee2 ("mm: memory-failure: Move memory failure sysctls to its own file")
> > >
> > > from the sysctl tree.
> > >
> > > I fixed it up (see below) and can carry the fix as necessary. This
> > > is now fixed as far as linux-next is concerned, but any non trivial
> > > conflicts should be mentioned to your upstream maintainer when your tree
> > > is submitted for merging. You may also want to consider cooperating
> > > with the maintainer of the conflicting tree to minimise any particularly
> > > complex conflicts.
> >
> > Sorry, I forgot the resolution - see below.

Thanks for resolving the conflicts, Stephen. It also looks good to me.

>
> Oh sorry, its on Linus' tree, so I can just rebase too. Did that and
> addressed the conflict as you did, thanks!
>
> Luis