Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1281054

Re: [PATCH v3 1/3] resource: Add @flags to region_intersects()

From Jeff Moyer <jmoyer@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 1/3] resource: Add @flags to region_intersects()
Date 2015-12-01 18:10 +0100
Message-ID <qAWBd-42t-39@gated-at.bofh.it> (permalink)
References <qyttF-59Z-11@gated-at.bofh.it> <qyttG-59Z-41@gated-at.bofh.it> <qATDk-1VN-25@gated-at.bofh.it> <qAWrw-3Jy-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Dan Williams <dan.j.williams@intel.com> writes:

>>> @@ -57,7 +57,7 @@ static void *try_ram_remap(resource_size_t offset, size_t size)
>>>   */
>>>  void *memremap(resource_size_t offset, size_t size, unsigned long flags)
>>>  {
>>> -     int is_ram = region_intersects(offset, size, "System RAM");
>>
>> Ok, question: why do those resource things types gets identified with
>> a string?! We have here "System RAM" and next patch adds "Persistent
>> Memory".
>>
>> And "persistent memory" or "System RaM" won't work and this is just
>> silly.
>>
>> Couldn't struct resource have gained some typedef flags instead which we
>> can much easily test? Using the strings looks really yucky.
>>
>
> At least in the case of region_intersects() I was just following
> existing strcmp() convention from walk_system_ram_range.

...which is done in the page fault path.  I agree with the suggestion to
get strcmp out of that path.

-Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Borislav Petkov <bp@alien8.de> - 2015-12-01 15:00 +0100
  Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Dan Williams <dan.j.williams@intel.com> - 2015-12-01 18:00 +0100
    Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Jeff Moyer <jmoyer@redhat.com> - 2015-12-01 18:10 +0100
    Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Linus Torvalds <torvalds@linux-foundation.org> - 2015-12-01 18:20 +0100
      Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Toshi Kani <toshi.kani@hpe.com> - 2015-12-03 19:00 +0100
        Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Borislav Petkov <bp@alien8.de> - 2015-12-03 19:50 +0100
          Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Linus Torvalds <torvalds@linux-foundation.org> - 2015-12-03 20:10 +0100
            Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Toshi Kani <toshi.kani@hpe.com> - 2015-12-03 20:50 +0100
              Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Dan Williams <dan.j.williams@gmail.com> - 2015-12-09 17:30 +0100
                Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Toshi Kani <toshi.kani@hpe.com> - 2015-12-09 22:50 +0100
    Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Borislav Petkov <bp@alien8.de> - 2015-12-01 18:20 +0100

csiph-web