linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] resource: Use list_head to link sibling resource
@ 2018-04-08  2:47 Baoquan He
  2018-04-08  2:47 ` [PATCH v2 1/3] " Baoquan He
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Baoquan He @ 2018-04-08  2:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Baoquan He

This post mainly converts strut resource's sibling list from singly
linked list to doubly linked list, list_head. This is suggested by
Andrew. Since I need a reversed searching on iomem_resource's
IORESOURCE_SYSTEM_RAM children,  the old singly linked list way makes
the code in v1 post really ugly.

With this change, we only need one simple list_for_each_entry_reverse()
to do reversed iteration on sibling list. The relevant codes in
kernel/resource.c are more readable since those dazzling pointer
operation codes for singly linked list are replaced. 

With the help of list_head, in patch 0002 we can have a very simple
walk_system_ram_res_rev(). And in patch 0003, will use it to search
available system RAM region for kexec_buffer of kexec_file from top to
down, just like we have been doing all along in kexec loading which is
done in kexec-tools utility.

Note:
This patchset passed testing on my kvm guest, x86_64 arch with network
enabling. The thing we need pay attetion to is that a root resource's
child member need be initialized specifically with LIST_HEAD_INIT() if
sttically defined or INIT_LIST_HEAD() for dynamically definition. Here
Just like we do for iomem_resource/ioport_resource, or the change in
get_pci_domain_busn_res().

And there are two places of change I am not very sure. One is in
drivers/hv/vmbus_drv.c, the other is in drivers/pci/host/vmd.c. So will
invite experts on these areas to help review.

v1->v2:
  Use list_head instead to link resource siblings. This is suggested by
  Andrew.

  Rewrite walk_system_ram_res_rev() after list_head is taken to link
  resouce siblings.

Baoquan He (3):
  resource: Use list_head to link sibling resource
  resource: add walk_system_ram_res_rev()
  kexec_file: Load kernel at top of system RAM if required

 drivers/gpu/drm/gma500/gtt.c                |   5 +-
 drivers/hv/vmbus_drv.c                      |  52 +++----
 drivers/input/joystick/iforce/iforce-main.c |   4 +-
 drivers/nvdimm/e820.c                       |   2 +-
 drivers/nvdimm/namespace_devs.c             |  14 +-
 drivers/nvdimm/nd.h                         |   5 +-
 drivers/of/address.c                        |   4 +-
 drivers/pci/host/vmd.c                      |   8 +-
 drivers/pci/probe.c                         |   2 +
 drivers/pci/setup-bus.c                     |   2 +-
 include/linux/ioport.h                      |   7 +-
 kernel/kexec_file.c                         |   2 +
 kernel/resource.c                           | 233 +++++++++++++++++-----------
 13 files changed, 196 insertions(+), 144 deletions(-)

-- 
2.13.6

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-04-11  3:22 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-08  2:47 [PATCH v2 0/3] resource: Use list_head to link sibling resource Baoquan He
2018-04-08  2:47 ` [PATCH v2 1/3] " Baoquan He
2018-04-08  4:12   ` kbuild test robot
2018-04-08  9:09     ` Baoquan He
2018-04-08  5:55   ` kbuild test robot
2018-04-08  9:09     ` Baoquan He
2018-04-09  9:08   ` [PATCH v3 1/3] resource: Use list_head to link resource sibling Baoquan He
2018-04-09 14:49     ` Rob Herring
2018-04-09 16:05       ` Nicolas Pitre
2018-04-10 13:44       ` Baoquan He
2018-04-11  3:22         ` Wei Yang
2018-04-09 15:38     ` Dan Williams
2018-04-10  2:10       ` Baoquan He
2018-04-10  2:34         ` Dan Williams
2018-04-10  2:49           ` Baoquan He
2018-04-08  2:47 ` [PATCH v2 2/3] resource: add walk_system_ram_res_rev() Baoquan He
2018-04-08  2:47 ` [PATCH v2 3/3] kexec_file: Load kernel at top of system RAM if required Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).