Re: svn commit: r362253 - head/sys/vm

2020-06-17 Thread Conrad Meyer
On Wed, Jun 17, 2020 at 4:04 AM Konstantin Belousov  wrote:
>
> On Tue, Jun 16, 2020 at 10:53:56PM +, Conrad Meyer wrote:
> > Author: cem
> > Date: Tue Jun 16 22:53:56 2020
> > New Revision: 362253
> > URL: https://svnweb.freebsd.org/changeset/base/362253
> >
> > Log:
> >   vm: Drop vm_map_clip_{start,end} macro wrappers
> >
> >   No functional change.
> >
> >   Reviewed by:dougm, markj
> >   Sponsored by:   Dell EMC Isilon
> >   Differential Revision:  https://reviews.freebsd.org/D25282
>
> I would highly appreciate if you revert this commit.
> It conflicts with https://reviews.freebsd.org/D24652, which must revert your
> change to remain functional.
> I probably should not allowed that review to rott silently.

Initially, I took a similar approach — converting the macros to inline
functions.  It was suggested in the review to just merge them, as they
were both relatively small.

I have a follow-up patch which will add a small amount of code to the
former macros.  (D25283)

I don't think there is any functional reason your patch cannot be
rebased over this change.  You could choose to merge
_vm_map_clip_start and vm_map_clip_start (and same for end) in your
patch; nothing invokes the underscore variants except the wrappers.
You could also choose to re-split the routines, although I'm not sure
why.  Either option seems acceptable to me.

Best,
Conrad
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r362253 - head/sys/vm

2020-06-17 Thread Konstantin Belousov
On Tue, Jun 16, 2020 at 10:53:56PM +, Conrad Meyer wrote:
> Author: cem
> Date: Tue Jun 16 22:53:56 2020
> New Revision: 362253
> URL: https://svnweb.freebsd.org/changeset/base/362253
> 
> Log:
>   vm: Drop vm_map_clip_{start,end} macro wrappers
>   
>   No functional change.
>   
>   Reviewed by:dougm, markj
>   Sponsored by:   Dell EMC Isilon
>   Differential Revision:  https://reviews.freebsd.org/D25282
> 
> Modified:
>   head/sys/vm/vm_map.c
> 
> Modified: head/sys/vm/vm_map.c
> ==
> --- head/sys/vm/vm_map.c  Tue Jun 16 21:30:30 2020(r362252)
> +++ head/sys/vm/vm_map.c  Tue Jun 16 22:53:56 2020(r362253)
> @@ -2377,24 +2377,17 @@ vm_map_entry_clone(vm_map_t map, vm_map_entry_t entry)
>   *   the specified address; if necessary,
>   *   it splits the entry into two.
>   */
> -#define vm_map_clip_start(map, entry, startaddr) \
> -{ \
> - if (startaddr > entry->start) \
> - _vm_map_clip_start(map, entry, startaddr); \
> -}
> -
> -/*
> - *   This routine is called only when it is known that
> - *   the entry must be split.
> - */
>  static inline void
> -_vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start)
> +vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start)
>  {
>   vm_map_entry_t new_entry;
>  
> + if (start <= entry->start)
> + return;
> +
>   VM_MAP_ASSERT_LOCKED(map);
>   KASSERT(entry->end > start && entry->start < start,
> - ("_vm_map_clip_start: invalid clip of entry %p", entry));
> + ("%s: invalid clip of entry %p", __func__, entry));
>  
>   new_entry = vm_map_entry_clone(map, entry);
>  
> @@ -2435,24 +2428,17 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t sta
>   *   the specified address; if necessary,
>   *   it splits the entry into two.
>   */
> -#define vm_map_clip_end(map, entry, endaddr) \
> -{ \
> - if ((endaddr) < (entry->end)) \
> - _vm_map_clip_end((map), (entry), (endaddr)); \
> -}
> -
> -/*
> - *   This routine is called only when it is known that
> - *   the entry must be split.
> - */
>  static inline void
> -_vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end)
> +vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end)
>  {
>   vm_map_entry_t new_entry;
>  
> + if (end >= entry->end)
> + return;
> +
>   VM_MAP_ASSERT_LOCKED(map);
>   KASSERT(entry->start < end && entry->end > end,
> - ("_vm_map_clip_end: invalid clip of entry %p", entry));
> + ("%s: invalid clip of entry %p", __func__, entry));
>  
>   new_entry = vm_map_entry_clone(map, entry);
>  
I would highly appreciate if you revert this commit.
It conflicts with https://reviews.freebsd.org/D24652, which must revert your
change to remain functional.

I probably should not allowed that review to rott silently.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362253 - head/sys/vm

2020-06-16 Thread Conrad Meyer
Author: cem
Date: Tue Jun 16 22:53:56 2020
New Revision: 362253
URL: https://svnweb.freebsd.org/changeset/base/362253

Log:
  vm: Drop vm_map_clip_{start,end} macro wrappers
  
  No functional change.
  
  Reviewed by:  dougm, markj
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25282

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cTue Jun 16 21:30:30 2020(r362252)
+++ head/sys/vm/vm_map.cTue Jun 16 22:53:56 2020(r362253)
@@ -2377,24 +2377,17 @@ vm_map_entry_clone(vm_map_t map, vm_map_entry_t entry)
  * the specified address; if necessary,
  * it splits the entry into two.
  */
-#define vm_map_clip_start(map, entry, startaddr) \
-{ \
-   if (startaddr > entry->start) \
-   _vm_map_clip_start(map, entry, startaddr); \
-}
-
-/*
- * This routine is called only when it is known that
- * the entry must be split.
- */
 static inline void
-_vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start)
+vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start)
 {
vm_map_entry_t new_entry;
 
+   if (start <= entry->start)
+   return;
+
VM_MAP_ASSERT_LOCKED(map);
KASSERT(entry->end > start && entry->start < start,
-   ("_vm_map_clip_start: invalid clip of entry %p", entry));
+   ("%s: invalid clip of entry %p", __func__, entry));
 
new_entry = vm_map_entry_clone(map, entry);
 
@@ -2435,24 +2428,17 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t sta
  * the specified address; if necessary,
  * it splits the entry into two.
  */
-#define vm_map_clip_end(map, entry, endaddr) \
-{ \
-   if ((endaddr) < (entry->end)) \
-   _vm_map_clip_end((map), (entry), (endaddr)); \
-}
-
-/*
- * This routine is called only when it is known that
- * the entry must be split.
- */
 static inline void
-_vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end)
+vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end)
 {
vm_map_entry_t new_entry;
 
+   if (end >= entry->end)
+   return;
+
VM_MAP_ASSERT_LOCKED(map);
KASSERT(entry->start < end && entry->end > end,
-   ("_vm_map_clip_end: invalid clip of entry %p", entry));
+   ("%s: invalid clip of entry %p", __func__, entry));
 
new_entry = vm_map_entry_clone(map, entry);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"