Skip to contentSkip to conversation

intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page()

PATCH Superseded Alaa Mohamed 4 participants 12 messages Apr 16, 2022 – Apr 19, 2022

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page()

Convert kmap() to kmap_local_page()

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

---
changes in V2:
fix kunmap_local path value to take address of the mapped page.
---
changes in V3:
edit commit message to be clearer

---
 drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +2 -2
index 2a5782063f4c..c14fc871dd41 100644
@@ -1798,14 +1798,14 @@ static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer,
 
 	frame_size >>= 1;
 
-	data = kmap(rx_buffer->page);
+	data = kmap_local_page(rx_buffer->page);
 
 	if (data[3] != 0xFF ||
 	    data[frame_size + 10] != 0xBE ||
 	    data[frame_size + 12] != 0xAF)
 		match = false;
 
-	kunmap(rx_buffer->page);
+	kunmap_local(data);
 
 	return match;
 }
Signature · 1 line
2.35.2
#1 lore raw
Quoted 4 lines · Alaa Mohamed

Convert kmap() to kmap_local_page()

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

It's not clearer. This is a general statement about the function. You need to explain why it is appropriate to use it here. Unless it is the case that all calls to kmap should be converted to call kmap_local_page.

julia

Quoted 38 lines

---
changes in V2:
fix kunmap_local path value to take address of the mapped page.
---
changes in V3:
edit commit message to be clearer

---
 drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +2 -3
index 2a5782063f4c..c14fc871dd41 100644
@@ -1798,14 +1798,14 @@ static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer,
 
 	frame_size >>= 1;
 
-	data = kmap(rx_buffer->page);
+	data = kmap_local_page(rx_buffer->page);
 
 	if (data[3] != 0xFF ||
 	    data[frame_size + 10] != 0xBE ||
 	    data[frame_size + 12] != 0xAF)
 		match = false;
 
-	kunmap(rx_buffer->page);
+	kunmap_local(data);
 
 	return match;
 }
--

2.35.2

#2 lore raw

PATCH v3 1/1 intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page()

Quoted 8 lines · Julia Lawall
Quoted 4 lines · Alaa Mohamed

Convert kmap() to kmap_local_page()

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

It's not clearer.

I mean this " fix kunmap_local path value to take address of the mapped page" be more clearer

Quoted 3 lines

This is a general statement about the function. You
need to explain why it is appropriate to use it here. Unless it is the case that all calls to kmap should be converted to call kmap_local_page.

It's required to convert all calls kmap to kmap_local_page. So, I don't what should the commit message be?

Is this will be good :

"kmap_local_page() was recently developed as a replacement for kmap().? The kmap_local_page() creates a mapping which is restricted to local use by a single thread of execution. "

Quoted 33 lines

julia

Quoted 30 lines

---
changes in V2:
fix kunmap_local path value to take address of the mapped page.
---
changes in V3:
edit commit message to be clearer

---
  drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +2 -2
index 2a5782063f4c..c14fc871dd41 100644
@@ -1798,14 +1798,14 @@ static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer,
 
  	frame_size >>= 1;
 
-	data = kmap(rx_buffer->page);
+	data = kmap_local_page(rx_buffer->page);
 
  	if (data[3] != 0xFF ||
  	    data[frame_size + 10] != 0xBE ||
  	    data[frame_size + 12] != 0xAF)
  		match = false;
 
-	kunmap(rx_buffer->page);
+	kunmap_local(data);
 
Quoted 7 lines
Quoted 7 lines
drivers/net/ethernet/intel/igb/igb_ethtool.c +0 -1
  	return match;
  }
--

2.35.2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20220416/173e7199/attachment-0001.html>

#3 lore raw
Quoted 23 lines · Alaa Mohamed
   On ???/??/???? ??:??, Julia Lawall wrote:

On Sat, 16 Apr 2022, Alaa Mohamed wrote:

Convert kmap() to kmap_local_page()

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

It's not clearer.

I mean this " fix kunmap_local path value to take address of the mapped page" be more clearer

This is a general statement about the function. You
need to explain why it is appropriate to use it here. Unless it is the case that all calls to kmap should be converted to call kmap_local_page.

It's required to convert all calls kmap to kmap_local_page. So, I don't what should the commit message be?

Quoted 7 lines

Is this will be good :

"kmap_local_page() was recently developed as a replacement for kmap(). The
kmap_local_page() creates a mapping which is restricted to local use by a single thread of execution. "

I think I am missing some thread context here. I'm not sure who said what above. So I'm going to start over.

Alaa,

It is important to remember that a good commit message says 2 things.

1) What is the problem you are trying to solve
2) Overview of the solution

First off I understand your frustration. In my opinion fixes and clean ups like this are very hard to write good commit messages for because so often the code diff seems so self explanatory. However, each code change comes at the identification of a problem. And remember that 'problem' does not always mean a bug fix.

The deprecation of kmap() may not seem like a problem. I mean why can't we just leave kmap() as it is? It works right?

But the problem is that the kmap (highmem) interface has become stale and its original purpose was targeted toward large memory systems with 32 bit kernels. There are very few systems being run like that any longer.

So how do we clean up the kmap interface to be more useful to the kernel community now that 32 bit kernels with highmem are so rare?

The community has identified that a first step of that is to move away from and eventually remove the kmap() call. This is due to the call being incorrectly used to create long term mappings. Most calls to kmap() are not used incorrectly but those call sites needed something in between kmap() and kmap_atmoic(). That call is kmap_local_page().

Now that kmap_local_page() exists the kmap() calls can be audited and most (I hope most)[1] can be replaced with kmap_local_page().

The change you have below is correct. But it lacks a good commit message. We need to cover the 2 points above.

1) Julia is asking why you needed to do this change. What is the problem or reason for this change? (Ira told you to is not a good reason. ;-)

PS In fact me telling you to may actually be a very bad reason... j/k ;-)

2) Why is this solution ok as part of the deprecation and removal of kmap()?

A final note; the 2 above points don't need a lot of text. Here I used 2 simple sentences.

https://lore.kernel.org/lkml/20220124015409.807587-2-ira.weiny at intel.com/

I hope this helps,
Ira

[1] But not all... some uses of kmap() have been identified as being pretty complex.

Quoted 38 lines

julia

---
changes in V2:
fix kunmap_local path value to take address of the mapped page.
---
changes in V3:
edit commit message to be clearer
---

  drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 2a5782063f4c..c14fc871dd41 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -1798,14 +1798,14 @@ static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer,

         frame_size >>= 1;

- data = kmap(rx_buffer->page);
+ data = kmap_local_page(rx_buffer->page);

         if (data[3] != 0xFF ||
             data[frame_size + 10] != 0xBE ||
             data[frame_size + 12] != 0xAF)
                 match = false;

- kunmap(rx_buffer->page);
+ kunmap_local(data);

         return match;

}
--
2.35.2

#4 lore raw
Quoted 82 lines · Ira Weiny
Quoted 23 lines · Alaa Mohamed
    On ???/??/???? ??:??, Julia Lawall wrote:

On Sat, 16 Apr 2022, Alaa Mohamed wrote:

Convert kmap() to kmap_local_page()

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

It's not clearer.

I mean this " fix kunmap_local path value to take address of the mapped page" be more clearer

This is a general statement about the function. You
need to explain why it is appropriate to use it here. Unless it is the case that all calls to kmap should be converted to call kmap_local_page.

It's required to convert all calls kmap to kmap_local_page. So, I don't what should the commit message be?

Quoted 7 lines

Is this will be good :

"kmap_local_page() was recently developed as a replacement for kmap(). The
kmap_local_page() creates a mapping which is restricted to local use by a single thread of execution. "

I think I am missing some thread context here. I'm not sure who said what above. So I'm going to start over.

Alaa,

It is important to remember that a good commit message says 2 things.

1) What is the problem you are trying to solve
2) Overview of the solution

First off I understand your frustration. In my opinion fixes and clean ups like this are very hard to write good commit messages for because so often the code diff seems so self explanatory. However, each code change comes at the identification of a problem. And remember that 'problem' does not always mean a bug fix.

The deprecation of kmap() may not seem like a problem. I mean why can't we just leave kmap() as it is? It works right?

But the problem is that the kmap (highmem) interface has become stale and its original purpose was targeted toward large memory systems with 32 bit kernels. There are very few systems being run like that any longer.

So how do we clean up the kmap interface to be more useful to the kernel community now that 32 bit kernels with highmem are so rare?

The community has identified that a first step of that is to move away from and eventually remove the kmap() call. This is due to the call being incorrectly used to create long term mappings. Most calls to kmap() are not used incorrectly but those call sites needed something in between kmap() and kmap_atmoic(). That call is kmap_local_page().

Now that kmap_local_page() exists the kmap() calls can be audited and most (I hope most)[1] can be replaced with kmap_local_page().

The change you have below is correct. But it lacks a good commit message. We need to cover the 2 points above.

1) Julia is asking why you needed to do this change. What is the problem or reason for this change? (Ira told you to is not a good reason. ;-)

PS In fact me telling you to may actually be a very bad reason... j/k ;-)

2) Why is this solution ok as part of the deprecation and removal of kmap()?

A final note; the 2 above points don't need a lot of text. Here I used 2 simple sentences.

Quoted 7 lines

https://lore.kernel.org/lkml/20220124015409.807587-2-ira.weiny at intel.com/

I hope this helps,
Ira

[1] But not all... some uses of kmap() have been identified as being pretty complex.

Thanks a lot for detailed explaining , yes you help me a lot.

Thanks again,

Alaa

Quoted 37 lines
Quoted 37 lines

julia

---
changes in V2:
fix kunmap_local path value to take address of the mapped page.
---
changes in V3:
edit commit message to be clearer
---

   drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 2a5782063f4c..c14fc871dd41 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -1798,14 +1798,14 @@ static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer,

          frame_size >>= 1;

- data = kmap(rx_buffer->page);
+ data = kmap_local_page(rx_buffer->page);

          if (data[3] != 0xFF ||
              data[frame_size + 10] != 0xBE ||
              data[frame_size + 12] != 0xAF)
                  match = false;

- kunmap(rx_buffer->page);
+ kunmap_local(data);

          return match;

}
--
2.35.2

#5 lore raw
In reply to Julia Lawall
Quoted 8 lines · Julia Lawall
Quoted 4 lines · Alaa Mohamed

Convert kmap() to kmap_local_page()

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

It's not clearer.

I mean this " fix kunmap_local path value to take address of the mapped page" be more clearer

Quoted 3 lines

This is a general statement about the function. You
need to explain why it is appropriate to use it here. Unless it is the case that all calls to kmap should be converted to call kmap_local_page.

It's required to convert all calls kmap to kmap_local_page. So, I don't what should the commit message be?

Is this will be good :

"kmap_local_page() was recently developed as a replacement for kmap().? The kmap_local_page() creates a mapping which is restricted to local use by a single thread of execution. "

Quoted 40 lines

julia

Quoted 37 lines

---
changes in V2:
fix kunmap_local path value to take address of the mapped page.
---
changes in V3:
edit commit message to be clearer

---
  drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +2 -3
index 2a5782063f4c..c14fc871dd41 100644
@@ -1798,14 +1798,14 @@ static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer,
 
  	frame_size >>= 1;
 
-	data = kmap(rx_buffer->page);
+	data = kmap_local_page(rx_buffer->page);
 
  	if (data[3] != 0xFF ||
  	    data[frame_size + 10] != 0xBE ||
  	    data[frame_size + 12] != 0xAF)
  		match = false;
 
-	kunmap(rx_buffer->page);
+	kunmap_local(data);
 
  	return match;
  }
--

2.35.2

#6 lore raw
Quoted 9 lines · Alaa Mohamed
Quoted 7 lines · Julia Lawall
Quoted 4 lines · Alaa Mohamed

Convert kmap() to kmap_local_page()

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

Quoted 8 lines
Quoted 1 line

It's not clearer.

I mean this " fix kunmap_local path value to take address of the mapped page" be more clearer

Quoted 3 lines

This is a general statement about the function. You
need to explain why it is appropriate to use it here. Unless it is the case that all calls to kmap should be converted to call kmap_local_page.

It's required to convert all calls kmap to kmap_local_page. So, I don't what should the commit message be?

If all calls should be changed then you can also say that.

I thought that a previous commit on the outreachy list made some arguments about how the affacted value was just allocated and thus could not yet be shared.

julia

Quoted 49 lines

Is this will be good :

"kmap_local_page() was recently developed as a replacement for kmap().? The kmap_local_page() creates a mapping which is restricted to local use by a single thread of execution. "

Quoted 42 lines

julia

Quoted 39 lines

---
changes in V2:
fix kunmap_local path value to take address of the mapped page.
---
changes in V3:
edit commit message to be clearer

---
  drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +2 -2
index 2a5782063f4c..c14fc871dd41 100644
@@ -1798,14 +1798,14 @@ static int igb_check_lbtest_frame(struct
 igb_rx_buffer *rx_buffer,
 
  	frame_size >>= 1;
 
-	data = kmap(rx_buffer->page);
+	data = kmap_local_page(rx_buffer->page);
 
  	if (data[3] != 0xFF ||
  	    data[frame_size + 10] != 0xBE ||
  	    data[frame_size + 12] != 0xAF)
  		match = false;
 
-	kunmap(rx_buffer->page);
+	kunmap_local(data);
 
  	return match;

}
--
2.35.2

#7 lore raw
Quoted 11 lines · On sabato 16 aprile 2022 16:09:58 CEST Julia Lawall wrote:
Quoted 8 lines · Alaa Mohamed
Quoted 6 lines · Julia Lawall
Quoted 3 lines · Alaa Mohamed

Convert kmap() to kmap_local_page()

With kmap_local_page(), the mapping is per thread, CPU local and

not

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

globally visible.

It's not clearer.

I mean this " fix kunmap_local path value to take address of the mapped

page"

Quoted 3 lines
Quoted 3 lines

be more clearer

Quoted 2 lines

This is a general statement about the function. You need to explain why it is appropriate to use it here. Unless it is

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

case that all calls to kmap should be converted to call

kmap_local_page.

Quoted 1 line
Quoted 1 line

It's required to convert all calls kmap to kmap_local_page. So, I don't

what

Quoted 3 lines
Quoted 1 line

should the commit message be?

If all calls should be changed then you can also say that.

If all calls should be changed with no regards to the surrounding contexts and special situations, we can just make an automated s/kmap()/ kmap_local_page()/ or something else similar :)

Thanks,

Fabio M. De Francesco

Quoted 2 lines

I thought that a previous commit on the outreachy list made some

arguments

Quoted 4 lines

about how the affacted value was just allocated and thus could not yet be shared.

julia

#8 lore raw

PATCH v3 1/1 intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page()

Quoted 5 lines · On sabato 16 aprile 2022 17:52:20 CEST Fabio M. De Francesco wrote:
Quoted 4 lines · On sabato 16 aprile 2022 16:09:58 CEST Julia Lawall wrote:
Quoted 1 line · Alaa Mohamed
Quoted 11 lines
Quoted 7 lines
Quoted 7 lines · Julia Lawall
Quoted 6 lines · Alaa Mohamed
Quoted 4 lines

Convert kmap() to kmap_local_page()

With kmap_local_page(), the mapping is per thread, CPU local and

not

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

globally visible.

It's not clearer.

I mean this " fix kunmap_local path value to take address of the

mapped

Quoted 8 lines

page"

Quoted 3 lines
Quoted 3 lines

be more clearer

Quoted 2 lines

This is a general statement about the function. You need to explain why it is appropriate to use it here. Unless it is

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

case that all calls to kmap should be converted to call

kmap_local_page.

Quoted 1 line
Quoted 1 line

It's required to convert all calls kmap to kmap_local_page. So, I

don't

Quoted 6 lines

what

Quoted 3 lines
Quoted 1 line

should the commit message be?

If all calls should be changed then you can also say that.

If all calls should be changed with no regards to the surrounding

contexts

Quoted 2 lines

and special situations, we can just make an automated s/kmap()/ kmap_local_page()/ or something else similar :)

Obviously, I was just kidding because we cannot massively and blindly change all kmap() calls to kmap_local_page().

IMO, here the changes in code are good but Julia's objections are legitimate too.

Thanks,

Fabio

Quoted 4 lines
Quoted 2 lines

I thought that a previous commit on the outreachy list made some

arguments

Quoted 1 line

about how the affacted value was just allocated and thus could not yet

be

Quoted 4 lines
Quoted 3 lines

shared.

julia

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20220416/51c29e10/attachment-0001.html>

#9 lore raw

PATCH v3 1/1 intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page()

In reply to Fabio M. De Francesco
Quoted 5 lines · On sabato 16 aprile 2022 17:52:20 CEST Fabio M. De Francesco wrote:
Quoted 2 lines · On sabato 16 aprile 2022 16:09:58 CEST Julia Lawall wrote:

If all calls should be changed then you can also say that.

If all calls should be changed with no regards to the surrounding

contexts

Quoted 2 lines

and special situations, we can just make an automated s/kmap()/ kmap_local_page()/ or something else similar :)

Hi Julia,

Of course I was just kidding when talking of massively automated substitutions. They are not feasible and we cannot blindly replace all kmap() calls with kmap_local_page().

Although these code changes look good, your objections are appropriate and legitimate.

Not all kmap() calls can be changed to kmap_local_page() and, if someone wants to make such replacements, they should also "prove" somehow that they are doing the right changes in that specific context.

For example, the following is one of those cases where such a replacement is not allowed and a different solution has yet to be found:

https://lore.kernel.org/lkml/2a7030f5-d55f-94c7-90ba-5a57235159f6 at amd.com/

Furthermore, if people cannot "prove" that this change is feasible, their patches will probably be ignored / rejected just because many maintainers still don't know if those changes are correct and safe.

Whoever wants to do these changes should understand the specific context in which they are working.

For example, there have also been cases where alloc_page() + kmap() was simply replaced by kmalloc(). Sure!

If you are interested to see how and why, please take a look at the commit 633b0616cfe0 ("x86/sgx: Remove unnecessary kmap() from sgx_ioc_enclave_init()") from Ira Weiny.

Regards,

Fabio

Quoted 4 lines
Quoted 2 lines

I thought that a previous commit on the outreachy list made some

arguments

Quoted 1 line

about how the affacted value was just allocated and thus could not yet

be

Quoted 4 lines
Quoted 3 lines

shared.

julia

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20220416/daee33e4/attachment-0001.html>

#10 lore raw
In reply to Fabio M. De Francesco
Quoted 1 line · On sabato 16 aprile 2022 17:52:20 CEST Fabio M. De Francesco wrote:

If all calls should be changed with no regards to the surrounding

contexts

Quoted 2 lines

and special situations, we can just make an automated s/kmap()/ kmap_local_page()/ or something else similar

(I'm afraid that somehow I messed up with the HTML filters in KMail therefore I have to send this email again to the Outreachy list because this message has already been rejected twice - I hope this time it works).

Hi Julia,

Of course I was just kidding when talking of massively automated

substitutions. They are not feasible and we cannot blindly replace all kmap() calls with kmap_local_page().

Although these code changes look good, your objections are appropriate and legitimate.

Not all kmap() calls can be changed to kmap_local_page() and, if someone wants to make such replacements, they should also "prove" somehow that they are doing the right changes in that specific context.

For example, the following is one of those cases where such a replacement is not allowed and a different solution has yet to be found:

https://lore.kernel.org/lkml/[email protected]/

Furthermore, if people cannot "prove" that this change is feasible, their patches will probably be ignored / rejected just because many maintainers still don't know if those changes are correct and safe.

Whoever wants to do these changes should understand the specific context in which they are working.

For example, there have also been cases where alloc_page() + kmap() was simply replaced by kmalloc(). Sure!

If you are interested to see how and why, please take a look at the commit 633b0616cfe0 ("x86/sgx: Remove unnecessary kmap() from sgx_ioc_enclave_init()") from Ira Weiny.

Regards,

Fabio

#11 lore raw
Quoted 24 lines · Fabio M. De Francesco
Quoted 1 line · On sabato 16 aprile 2022 17:52:20 CEST Fabio M. De Francesco wrote:

If all calls should be changed with no regards to the surrounding

contexts

Quoted 2 lines

and special situations, we can just make an automated s/kmap()/ kmap_local_page()/ or something else similar

(I'm afraid that somehow I messed up with the HTML filters in KMail therefore I have to send this email again to the Outreachy list because this message has already been rejected twice - I hope this time it works).

Hi Julia,

Of course I was just kidding when talking of massively automated

substitutions. They are not feasible and we cannot blindly replace all kmap() calls with kmap_local_page().

Although these code changes look good, your objections are appropriate and legitimate.

Not all kmap() calls can be changed to kmap_local_page() and, if someone wants to make such replacements, they should also "prove" somehow that they are doing the right changes in that specific context.

Quoted 8 lines

For example, the following is one of those cases where such a replacement is not allowed and a different solution has yet to be found:

https://lore.kernel.org/lkml/[email protected]/

Furthermore, if people cannot "prove" that this change is feasible, their patches will probably be ignored / rejected just because many maintainers still don't know if those changes are correct and safe.

I think that all patches in which the log message does not explain why the change is correct should be rejected. Not because the maintainer can't do the proof himself, but because the reasoning should be explicit in the git history.

julia

Quoted 19 lines

Whoever wants to do these changes should understand the specific context in which they are working.

For example, there have also been cases where alloc_page() + kmap() was simply replaced by kmalloc(). Sure!

If you are interested to see how and why, please take a look at the commit 633b0616cfe0 ("x86/sgx: Remove unnecessary kmap() from sgx_ioc_enclave_init()") from Ira Weiny.

Regards,

Fabio