Patent Description:
The Android operating system (OS) may load a kernel module using a generic kernel image (GKI). The GKI may refer to a policy for minimizing the difference between a Linux mainline kernel and an Android kernel and using an Android kernel image by a vendor and an original equipment manufacturing (OEM) company without modification to decrease fragmentation among a Linux mainline kernel, a chipset vendor kernel, and an OEM kernel.

To operate a kernel driver of a chipset vendor and that of an OEM company, kernel drivers of the OEM company and the chipset vendor, which are developed as built-in conventionally and included in a kernel image, may need to be developed in the form of a loadable kernel module.

Because the loadable kernel module may load or unload a built loadable kernel module at an operation time of a terminal even if a kernel module is not built therewith when the kernel image is built, the loadable kernel module may properly load a kernel module that is built with a GKI of a different version or another kernel when the GKI is updated with a security or bug fix. <NPL>, discloses a two phased approach for loading kernel modules that combines course grain scheduling of kernels followed by opportunistic fine-grained workgroup-level partitioning to exploit idle resources.

A typical method of loading a kernel module may cause a delay in the module load speed because the method may not load kernel modules in a plurality of threads in parallel and may continuously load the kernel modules in a single thread.

To load modules in a plurality of threads, it may be required to classify modules performed in a limited thread and group the classified modules.

According to various embodiments, an electronic device include at least one processor and a memory configured to store instructions to be executed by the processor, wherein the processor is configured to generate dependency relationship data based on dependency among a plurality of kernel modules executed by the processor determine a first kernel module to be loaded in a first stage among the plurality of kernel modules based on the dependency relationship data, and generate a plurality of kernel module groups by determining a second kernel module to be loaded in a second stage among the plurality of kernel modules based on the dependency relationship data and the first kernel module.

According to various embodiments, an electronic device include at least one processor and a memory configured to store instructions to be executed by the processor, wherein the processor is configured to receive a plurality of kernel module groups generated based on dependency among a plurality of kernel modules executed by the processor, perform parallel loading on the plurality of kernel modules based on the plurality of kernel module groups, and generate a restructured kernel module group by restructuring the plurality of kernel module groups based on the load time of the plurality of kernel modules.

According to various embodiments, a method of an electronic device to load a kernel module includes receiving a plurality of kernel modules generated based on dependency among a plurality of kernel modules, performing parallel loading on the plurality of kernel modules based on the plurality of kernel module groups, and generating a restructured kernel module group by restructuring the plurality of kernel module groups based on a load time of the plurality of kernel modules.

According to various embodiments, an electronic device may improve the load speed of a kernel module by classifying the kernel module and increasing the number of parallel loads.

According to various embodiments, the electronic device may improve the load speed of a kernel module by grouping kernel modules and loading the grouped kernel modules in parallel.

According to various embodiments, stability may be secured and load speed may be improved by restructuring a kernel module group based on the actual load time of a kernel module.

<FIG> is a block diagram of an electronic device <NUM> in a network environment <NUM> according to various embodiments. Referring to <FIG>, the electronic device <NUM> in the network environment <NUM> may communicate with an electronic device <NUM> via a first network <NUM> (e.g., a short-range wireless communication network), or communicate with at least one of an electronic device <NUM> or a server <NUM> via a second network <NUM> (e.g., a long-range wireless communication network). According to one embodiment, the electronic device <NUM> may communicate with the electronic device <NUM> via the server <NUM>. According to one embodiment, the electronic device <NUM> may include a processor <NUM>, a memory <NUM>, an input module <NUM>, a sound output module <NUM>, a display module <NUM>, an audio module <NUM>, and a sensor module <NUM>, an interface <NUM>, a connecting terminal <NUM>, a haptic module <NUM>, a camera module <NUM>, a power management module <NUM>, a battery <NUM>, a communication module <NUM>, a subscriber identification module (SIM) <NUM>, or an antenna module <NUM>. In some embodiments, at least one (e.g., the connecting terminal <NUM>) of the above components may be omitted from the electronic device <NUM>, or one or more other components may be added to the electronic device <NUM>. In some embodiments, some (e.g., the sensor module <NUM>, the camera module <NUM>, or the antenna module <NUM>) of the components may be integrated as a single component (e.g., the display module <NUM>).

The processor <NUM> may execute, for example, software (e.g., a program <NUM>) to control at least one other component (e.g., a hardware or software component) of the electronic device <NUM> connected to the processor <NUM>, and may perform various data processing or computation. According to one embodiment, as at least a part of data processing or computation, the processor <NUM> may store a command or data received from another component (e.g., the sensor module <NUM> or the communication module <NUM>) in a volatile memory <NUM>, process the command or the data stored in the volatile memory <NUM>, and store resulting data in a non-volatile memory <NUM>. According to one embodiment, the processor <NUM> may include a main processor <NUM> (e.g., a central processing unit (CPU) or an application processor (AP)) or an auxiliary processor <NUM> (e.g., a graphics processing unit (GPU), a neural processing unit (NPU), an image signal processor (ISP), a sensor hub processor, or a communication processor (CP)) that is operable independently from, or in conjunction with the main processor <NUM>. For example, when the electronic device <NUM> includes the main processor <NUM> and the auxiliary processor <NUM>, the auxiliary processor <NUM> may be adapted to consume less power than the main processor <NUM> or to be specific to a specified function. The auxiliary processor <NUM> may be implemented separately from the main processor <NUM> or as a part of the main processor <NUM>.

The auxiliary processor <NUM> may control at least some of functions or states related to at least one (e.g., the display module <NUM>, the sensor module <NUM>, or the communication module <NUM>) of the components of the electronic device <NUM>, instead of the main processor <NUM> while the main processor <NUM> is in an inactive (e.g., sleep) state or along with the main processor <NUM> while the main processor <NUM> is an active state (e.g., executing an application). According to one embodiment, the auxiliary processor <NUM> (e.g., an ISP or a CP) may be implemented as a portion of another component (e.g., the camera module <NUM> or the communication module <NUM>) that is functionally related to the auxiliary processor <NUM>. According to one embodiment, the auxiliary processor <NUM> (e.g., an NPU) may include a hardware structure specified for artificial intelligence (AI) model processing. An AI model may be generated through machine learning. Such learning may be performed by, for example, the electronic device <NUM> in which artificial intelligence is performed, or performed via a separate server (e.g., the server <NUM>). Learning algorithms may include, but are not limited to, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning. The AI model may include a plurality of artificial neural network layers. An artificial neural network may include, for example, a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more thereof, but is not limited thereto. The AI model may additionally or alternatively include a software structure other than the hardware structure.

The various pieces of data may include, for example, software (e.g., the program <NUM>) and input data or output data for a command related thereto.

The program <NUM> may be stored as software in the memory <NUM> and may include, for example, an operating system (OS) <NUM>, middleware <NUM>, or an application <NUM>.

The sound output module <NUM> may output a sound signal to the outside of the electronic device <NUM>. The receiver may be used to receive an incoming call. According to one embodiment, the receiver may be implemented separately from the speaker or as a part of the speaker.

The display module <NUM> may include, for example, a display, a hologram device, or a projector and control circuitry to control a corresponding one of the display, the hologram device, and the projector. According to one embodiment, the display module <NUM> may include a touch sensor adapted to sense a touch, or a pressure sensor adapted to measure an intensity of a force incurred by the touch.

The audio module <NUM> may convert a sound into an electrical signal or vice versa. According to one embodiment, the audio module <NUM> may obtain the sound via the input module <NUM> or output the sound via the sound output module <NUM> or an external electronic device (e.g., an electronic device <NUM> such as a speaker or headphones) directly or wirelessly connected to the electronic device <NUM>.

The sensor module <NUM> may detect an operational state (e.g., power or temperature) of the electronic device <NUM> or an environmental state (e.g., a state of a user) external to the electronic device <NUM>, and generate an electric signal or data value corresponding to the detected state. According to one embodiment, the sensor module <NUM> may include, for example, a gesture sensor, a gyro sensor, an atmospheric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an infrared (IR) sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.

The interface <NUM> may support one or more specified protocols to be used for the electronic device <NUM> to be coupled with the external electronic device (e.g., the electronic device <NUM>) directly (e.g., by wire) or wirelessly. According to one embodiment, the interface <NUM> may include, for example, a high-definition multimedia interface (HDMI), a universal serial bus (USB) interface, a secure digital (SD) card interface, or an audio interface.

The connecting terminal <NUM> may include a connector via which the electronic device <NUM> may be physically connected to an external electronic device (e.g., the electronic device <NUM>).

The haptic module <NUM> may convert an electric signal into a mechanical stimulus (e.g., a vibration or a movement) or an electrical stimulus which may be recognized by a user via his or her tactile sensation or kinesthetic sensation. According to one embodiment, the haptic module <NUM> may include, for example, a motor, a piezoelectric element, or an electric stimulator.

The camera module <NUM> may capture a still image and moving images. According to one embodiment, the camera module <NUM> may include one or more lenses, image sensors, ISPs, or flashes.

According to one embodiment, the power management module <NUM> may be implemented as, for example, at least a part of a power management integrated circuit (PMIC).

The communication module <NUM> may include one or more CPs that are operable independently from the processor <NUM> (e.g., an AP) and that support a direct (e.g., wired) communication or a wireless communication. According to one embodiment, the communication module <NUM> may include a wireless communication module <NUM> (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module <NUM> (e.g., a local area network (LAN) communication module, or a power line communication (PLC) module). A corresponding one of these communication modules may communicate with the external electronic device <NUM> via the first network <NUM> (e.g., a short-range communication network, such as Bluetooth™, wireless-fidelity (Wi-Fi) direct, or infrared data association (IrDA)) or the second network <NUM> (e.g., a long-range communication network, such as a legacy cellular network, a <NUM> network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or a wide area network (WAN)). The wireless communication module <NUM> may identify and authenticate the electronic device <NUM> in a communication network, such as the first network <NUM> or the second network <NUM>, using subscriber information (e.g., international mobile subscriber identity (IMSI)) stored in the SIM <NUM>.

The wireless communication module <NUM> may support a <NUM> network after a <NUM> network, and next-generation communication technology, e.g., new radio (NR) access technology. The wireless communication module <NUM> may support a high-frequency band (e.g., a mmWave band) to achieve, e.g., a high data transmission rate. The wireless communication module <NUM> may support various technologies for securing performance on a high-frequency band, such as, e.g., beamforming, massive multiple-input and multiple-output (MIMO), full dimensional MIMO (FD-MIMO), an array antenna, analog beam-forming, or a large scale antenna. According to one embodiment, the wireless communication module <NUM> may support a peak data rate (e.g., <NUM> Gbps or more) for implementing eMBB, loss coverage (e.g., <NUM> dB or less) for implementing mMTC, or U-plane latency (e.g., <NUM> or less for each of downlink (DL) and uplink (UL), or a round trip of <NUM> or less) for implementing URLLC.

The antenna module <NUM> may transmit or receive a signal or power to or from the outside (e.g., an external electronic device) of the electronic device <NUM>. According to one embodiment, the antenna module <NUM> may include an antenna including a radiating element including a conductive material or a conductive pattern formed in or on a substrate (e.g., a printed circuit board (PCB)). According to one embodiment, the antenna module <NUM> may include a plurality of antennas (e.g., array antennas). In such a case, at least one antenna appropriate for a communication scheme used in a communication network, such as the first network <NUM> or the second network <NUM>, may be selected by, for example, the communication module <NUM> from the plurality of antennas. The signal or power may be transmitted or received between the communication module <NUM> and the external electronic device via the at least one selected antenna. According to one embodiment, another component (e.g., a radio frequency integrated circuit (RFIC)) other than the radiating element may be additionally formed as a part of the antenna module <NUM>.

According to one embodiment, the antenna module <NUM> may form a mmWave antenna module. According to one embodiment, the mmWave antenna module may include a PCB, an RFIC disposed on a first surface (e.g., a bottom surface) of the PCB or adjacent to the first surface and capable of supporting a designated a high-frequency band (e.g., a mmWave band), and a plurality of antennas (e.g., array antennas) disposed on a second surface (e.g., a top or a side surface) of the PCB, or adjacent to the second surface and capable of transmitting or receiving signals in the designated high-frequency band.

According to one embodiment, commands or data may be transmitted or received between the electronic device <NUM> and the external electronic device <NUM> via the server <NUM> coupled with the second network <NUM>. Each of the external electronic devices <NUM> and <NUM> may be a device of the same type as or a different type from the electronic device <NUM>. According to one embodiment, all or some of operations to be executed by the electronic device <NUM> may be executed at one or more external electronic devices (e.g., the external electronic devices <NUM> and <NUM>, and the server <NUM>). For example, if the electronic device <NUM> needs to perform a function or a service automatically, or in response to a request from a user or another device, the electronic device <NUM>, instead of, or in addition to, executing the function or the service, may request one or more external electronic devices to perform at least part of the function or the service. The one or more external electronic devices receiving the request may perform the at least part of the function or the service requested, or an additional function or an additional service related to the request, and may transfer an outcome of the performing to the electronic device <NUM>. The electronic device <NUM> may provide the result, with or without further processing the result, as at least part of a response to the request. To that end, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used, for example. In another embodiment, the external electronic device <NUM> may include an Internet-of-things (IoT) device. According to one embodiment, the external electronic device <NUM> or the server <NUM> may be included in the second network <NUM>. The electronic device <NUM> may be applied to intelligent services (e.g., a smart home, a smart city, a smart car, or healthcare) based on <NUM> communication technology or IoT-related technology.

<FIG> is a diagram illustrating an operation of managing a memory of an electronic device, according to various embodiments.

According to various embodiments, a processor (e.g., the processor <NUM> of <FIG>) may load a kernel module. The processor <NUM> may generate a kernel module group by grouping a plurality of kernel modules, may secure the stability of an electronic device (e.g., the electronic device <NUM> of <FIG>) by loading kernel modules in parallel based on the kernel module group, and may improve an operation speed.

According to various embodiments, the kernel may be a core component of an OS and may be a program for managing a resource in a computer for a user program (or an application) to use the resource. The kernel may provide various services required to operate an OS and an application program. For example, the kernel may be system software providing an interface for managing a process, a file, a network, and a device. The kernel module may be a unit of independent software or hardware dynamically loaded to or unloaded from the kernel.

According to various embodiments, the processor <NUM> may classify a module to be loaded in a first stage (e.g., first stage init) and a second stage (e.g., second stage init) in a build-time based on dependency between kernel modules and may generate a kernel module group by grouping modules loaded in the second stage.

According to various embodiments, the processor <NUM> may generate dependency relationship data based on dependency among a plurality of kernel modules executed by the processor <NUM>. The dependency relationship data may include a dependency graph including nodes and an edge connecting the nodes to each other. A process of generating the dependency graph based on the dependency is described with reference to <FIG>. The kernel module dependency may include a loading order or a priority required when the kernel modules are loaded.

According to various embodiments, among a plurality of kernel module A, B, C, M, N, S, V, T, and W, the processor <NUM> may generate a plurality of kernel module groups <NUM> and <NUM> to <NUM> based on dependency among the kernel modules. Although three kernel module groups are illustrated as an example in <FIG>, the number of kernel module groups may be less than three or greater than three according to an embodiment.

According to various embodiments, to load the kernel module N in <FIG>, the kernel module M may need to be priorly loaded. To load the kernel module N, the kernel module A may need to be priorly loaded. In this case, the kernel modules A, M, and N may have dependencies on each other.

According to various embodiments, to load the kernel module T in <FIG>, the kernel module S may need to be priorly loaded. To load the kernel module S, the kernel module B may need to be priorly loaded. In this case, the kernel modules B, S, and T may have dependencies on each other.

According to various embodiments, to load the kernel module W in <FIG>, the kernel module V may need to be priorly loaded. To load the kernel module V, the kernel module C may need to be priorly loaded. In this case, the kernel modules C, V, and W may have dependencies on each other.

According to various embodiments, the processor <NUM> may generate a group <NUM><NUM> and a group <NUM><NUM> to a group <NUM><NUM> based on the dependency.

According to various embodiments, the processor <NUM> may determine a first kernel to be loaded in the a first stage among a plurality of kernel modules based on the dependency relationship data.

<FIG> illustrates an operation of loading a kernel module, according to various embodiments.

Referring to <FIG>, a processor (e.g., the processor <NUM> of <FIG>) may load a kernel module. The processor <NUM> may perform parallel loading on a plurality of kernel modules based on a plurality of kernel module groups generated based on dependency.

According to various embodiments, a kernel image <NUM> may include at least one thread. The kernel image <NUM> may be a file including content of a kernel stored in a memory (e.g., the memory <NUM> of <FIG>). The kernel image <NUM> may include at least one thread and a plurality of kernel modules included in the thread.

According to various embodiments, the processor <NUM> determines a first kernel to be loaded in a first stage <NUM> among a plurality of kernel modules based on dependency relationship data. The processor <NUM> generates a plurality of kernel module groups by determining a second kernel module to be loaded in a second stage among the plurality of kernel modules based on the dependency relationship data and the first kernel module. The processor <NUM> may classify the plurality of kernel modules into the plurality of kernel module groups based on the first kernel module and the second kernel module.

According to various embodiments, a single thread may be executed in the first stage <NUM>. The processor <NUM> may initialize a kernel driver through the single thread of the first stage <NUM>. The first stage <NUM> may continuously load the plurality of kernel modules in the single thread.

According to various embodiments, the processor <NUM> performs parallel loading of kernel modules using a plurality of threads <NUM>-<NUM>, <NUM>-<NUM>,. , <NUM>-n of a second stage <NUM>. The processor <NUM> may perform parallel loading on the plurality of kernel modules based on the plurality of kernel module groups in the second stage <NUM>. An operation of loading a kernel module of the first stage <NUM> may be performed chronologically ahead of an operation of loading a kernel module of the second stage <NUM>.

According to various embodiments, the processor <NUM> may classify kernel modules to be loaded in the first stage <NUM> and the second stage <NUM> and may improve the load speed of all the kernel modules by increasing the number of parallel loadings occurring in the second stage <NUM>.

<FIG> is a flowchart illustrating operations of an electronic device during a build-time and a run-time, according to various embodiments.

Referring to <FIG>, according to various embodiments, a build-time operation and a run-time operation may be performed by different hardware devices. The build-time operation may be performed by a first electronic device (e.g., the electronic device <NUM> of <FIG>) and the run-time operation may be performed by a second electronic device (e.g., the electronic device <NUM> of <FIG>).

According to various embodiments, the first electronic device may include a first processor (e.g., the first processor <NUM> of <FIG>) and the second electronic device may include a second processor (e.g., the second processor <NUM> of <FIG>).

According to various embodiments, in operation <NUM>, the first processor obtains dependency among a plurality of kernel modules. In operation <NUM>, the first processor generates a dependency graph based on the dependency among the plurality of kernel modules. The first processor may generate nodes corresponding to the plurality of kernel modules. The first processor generates the dependency graph by generating an edge connecting the nodes based on the dependency.

According to various embodiments, the first processor generates the dependency graph by determining a first kernel module to be a root node of the dependency graph and connecting a second kernel module as a child node of the root node.

According to various embodiments, the first processor may generate a data set related to relationship information among kernel modules and may identify dependency among the kernel modules through the data set.

According to various embodiments, in operation <NUM>, the first processor determines the first kernel module to be loaded in a first stage among the plurality of kernel modules based on the dependency graph. In operation <NUM>, the first processor generates a plurality of kernel module groups by determining a second kernel module to be loaded in a second stage among the plurality of kernel modules based on the dependency graph and the first kernel module. The operation of loading a kernel module of the first stage may be performed chronologically ahead of the operation of loading a kernel module of the second stage.

According to various embodiments, the first processor performs parallel loading on the plurality of kernel modules based on the plurality of kernel module groups.

According to various embodiments, in operation <NUM>, the first processor may restructure the plurality of kernel module groups. The first processor measures a load time of the plurality of kernel module groups. The first processor generates a restructured kernel module group by restructuring the plurality of kernel module groups based on the load time.

According to various embodiments, the first processor integrates a first kernel module group with a second kernel module group in the plurality of kernel module groups based on the load time. The first processor measures load times of the first kernel module group, the second kernel module group, and a third kernel module group among the plurality of kernel module groups.

According to various embodiments, when the load time of the third kernel module group is greater than the load time of the first kernel module group and the load time of the second kernel module group, the first processor integrates the first kernel module group with the second kernel module group.

According to various embodiments, the first processor may generate a kernel module group by separating at least one kernel module group based on the load time. The first processor may measure load times of the first kernel module group and the second kernel module group among the plurality of kernel module groups.

According to various embodiments, when the load time of the second kernel module group is greater than the load time of the first kernel module group, the first processor may generate a fourth kernel module group and a fifth kernel module group by separating the second kernel module group. The first processor may decrease the total kernel module load time by dividing a kernel module group of which the load time is relatively long.

According to various embodiments, the second processor may receive a plurality of kernel module groups generated based on dependency among a plurality of kernel modules executed by the second processor. In operation <NUM>, the second processor may perform parallel loading based on the received kernel module group and may measure the load time of the plurality of kernel modules.

According to various embodiments, the second processor may perform parallel loading on the plurality of kernel modules based on the plurality of kernel module groups. The second processor may generate a restructured kernel module group by restructuring the plurality of kernel module groups based on the load time of the plurality of kernel modules.

According to various embodiments, in operation <NUM>, the second processor may determine whether the second electronic device is on an initial boot or the second electronic device is on a first boot after over the air (OTA). In operation <NUM>, when the second electronic device is on the initial boot or the first boot after OTA, the second processor may perform parallel loading based on the plurality of kernel module groups.

According to various embodiments, in operation <NUM>, when the second electronic device is not on the initial boot or the first boot after OTA, the second processor may generate a restructured kernel module group by restructuring the plurality of kernel module groups based on the measured load time.

According to various embodiments, the second processor may integrate the first kernel module group with the second kernel module group among the plurality of kernel module groups based on the load time. The second processor may measure load times of the first kernel module group, the second kernel module group, and a third kernel module group among the plurality of kernel module groups. When the load time of the third kernel module group is greater than the load time of the first kernel module group and the load time of the second kernel module group, the second processor may integrate the first kernel module group with the second kernel module group.

According to various embodiments, the second processor may generate a kernel module group by separating at least one kernel module group based on the load time. The second processor may measure load times of the first kernel module group and the second kernel module group among the plurality of kernel module groups. When the load time of the second kernel module group is greater than the load time of the first kernel module group, the second processor may generate a fourth kernel module group and a fifth kernel module group by separating the second kernel module group.

According to various embodiments, the second processor may restructure the plurality of kernel module groups using a dependency graph generated based on the dependency. The dependency graph may include nodes corresponding to the plurality of kernel modules and may include an edge connecting the nodes based on the dependency. According to various embodiments, the second processor may perform parallel loading again on the plurality of kernel module groups based on the restructured kernel module group.

According to various embodiments, in operation <NUM>, the second processor may operate kernel modules loaded in parallel.

<FIG> illustrates dependency of kernel modules according to various embodiments and <FIG> illustrates a dependency graph according to various embodiments.

Referring to <FIG> and <FIG>, according to various embodiments, a processor (e.g., the processor <NUM> of <FIG>) may obtain dependency among a plurality of kernel modules. The dependency may be a relationship with other kernel modules to be priorly loaded to load an arbitrary kernel module.

According to various embodiments, in <FIG>, numbers <NUM> to <NUM> may be numbers corresponding to kernel modules, respectively. A number after a colon may be a kernel module to be priorly loaded to load a kernel module before the colon. In other words, a number after a colon may be a kernel module having dependency with a kernel module before the colon. For example, to load a kernel module <NUM>, a kernel module to be priorly loaded may not exist and the kernel module <NUM> may be priorly loaded to load a kernel module <NUM>. The kernel module <NUM> and the kernel module <NUM> may need to be priorly loaded to load a kernel module <NUM> and the kernel modules <NUM>, <NUM>, and <NUM> may need to be priorly loaded to load a kernel module <NUM>. As described above, kernel modules <NUM> to <NUM> may have dependencies.

According to various embodiments, the processor <NUM> may generate a dependency graph based on the dependency. The processor <NUM> may generate the dependency graph in the form of a tree. The processor may generate the dependency graph based on dependency among the plurality of kernel modules. The processor may generate nodes corresponding to the plurality of kernel modules. The processor may generate the dependency graph by generating an edge connecting the nodes based on the dependency.

According to various embodiments, the processor <NUM> may determine a first kernel module to be a root node of the dependency graph. The processor <NUM> may determine a kernel module to be loaded first to be the root node of the dependency graph. For example, the processor <NUM> may determine the kernel modules <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> to be root nodes. The processor may priorly load the kernel modules determined to be the root nodes in the first stage.

According to various embodiments, the processor <NUM> may generate the dependency graph by connecting a second kernel module to a child node of the root node. The processor <NUM> may connect a child node based on a load order based on the dependency. For example, the processor <NUM> may connect the kernel module <NUM> to the kernel module <NUM>, the kernel module <NUM> to the kernel module <NUM>, and the kernel module <NUM> to the kernel module <NUM>. The processor may generate a graph <NUM> by connecting the kernel module <NUM> to the kernel module <NUM>. In this case, the kernel modules <NUM>, <NUM>, <NUM>, and <NUM> may be loaded in the second stage. The processor <NUM> may cause the root nodes to be included in the build-time as vendor-boot. image such that the root nodes may be loaded in the first stage.

According to various embodiments, the processor <NUM> may generate a graph <NUM> and a graph <NUM> by connecting child nodes to the kernel modules <NUM>, <NUM>, <NUM>, and <NUM> based on the dependency. In the examples of <FIG> and <FIG>, the kernel modules loaded in the first stage and the second stage may be summarized as shown in Table <NUM>.

According to various embodiments, the graphs <NUM>, <NUM>, and <NUM> may correspond to kernel module groups, respectively. The number of generated kernel module groups may vary depending on the dependency among the kernel modules.

<FIG> illustrates an example of a kernel module group according to various embodiments and <FIG> illustrates an example of a restructured kernel module group according to various embodiments.

Referring to <FIG>, according to various embodiments, a processor (e.g., the processor <NUM> of <FIG>) may generate a plurality of kernel module groups based on a dependency graph. The processor <NUM> may generate a restructured kernel module group by performing restructuring based on the load time of the plurality of kernel module groups. Restructuring the kernel module group may be performed in both of the build-time or run-time. Restructuring of a module group performed in the build-time may be performed based on the actual kernel loading time in a previous boot.

According to various embodiments, the processor <NUM> may generate a kernel module group <NUM>, a kernel module group <NUM>, and a kernel module group <NUM> based on the dependency graph. The processor <NUM> may measure load times of the kernel module groups <NUM>, <NUM>, and <NUM> and may perform restructuring based on the load time. The kernel modules included in the kernel module group may be expressed as Table <NUM>.

According to various embodiments, the processor <NUM> may integrate at least two of the kernel module group <NUM>, the kernel module group <NUM>, and the kernel module group <NUM> based on the load times of the kernel module groups <NUM>, <NUM>, and <NUM>. When the load time of the kernel module group <NUM> is greater than the load time of the kernel module group <NUM> and the load time of the kernel module group <NUM>, the processor <NUM> may generate a restructured kernel module group <NUM> by integrating the kernel module group <NUM> with the kernel module group <NUM>. The processor <NUM> may prevent a problem that a parallel loading effect of which the load time is relatively long is degraded through restructuring the kernel module group. In this case, for the kernel load time, one piece of data may be used for each model. The kernel modules included in the restructured kernel module group <NUM> and the kernel module group <NUM> may be expressed as Table <NUM>.

According to various embodiments, the processor <NUM> may improve the kernel module load speed by allocating a single thread to each kernel module group and performing parallel loading at an operation time of an electronic device (e.g., the electronic device <NUM> of <FIG>) using the restructured module group. For example, the processor <NUM> may load the kernel module group <NUM> and the kernel module group <NUM> in parallel respectively through a single thread. In this case, the number of threads used for parallel loading may be the same as the number of module groups after restructuring.

Referring to <FIG>, according to various embodiments, a processor (e.g., the processor <NUM> of <FIG>) may generate a plurality of kernel module groups based on a dependency graph. The processor <NUM> may generate a restructured kernel module group by performing restructuring based on the load time of the plurality of kernel module groups.

According to various embodiments, the processor <NUM> may generate a kernel module group <NUM> and a kernel module group <NUM> based on the dependency graph. The processor <NUM> may measure the load time of the kernel module group <NUM> and the load time of the kernel module group <NUM>. The processor <NUM> may further generate a kernel module group by separating at least one kernel module group based on the measured load time.

According to various embodiments, the processor <NUM> may measure load times of the kernel module groups <NUM> and <NUM> and when the load time of the kernel module group <NUM> is greater than the load time of the kernel module group <NUM>, the processor <NUM> may generate a kernel module group <NUM> and a kernel module group <NUM> by separating the kernel module group <NUM>.

<FIG> illustrates a restructuring operation performed by an electronic device, according to various embodiments. A processor (e.g., the processor <NUM> of <FIG>) may generate a restructured kernel module group by restructuring a plurality of kernel module groups based on the load time of a plurality of kernel modules.

According to various embodiments, when an electronic device (e.g., the electronic device <NUM> of <FIG>) is on an initial boot or the first boot after OTA, the processor <NUM> may perform parallel loading using kernel module group data included in an OTA image. In this case, the processor <NUM> may store the actual load time of a kernel module in a memory (e.g., the memory <NUM> of <FIG>). The processor <NUM> may dynamically restructure a kernel module group using the load time stored in an idle time of the electronic device <NUM>.

According to various embodiments, the processor <NUM> may dynamically restructure a kernel module group during a run-time. In operation <NUM>, the processor <NUM> may measure the load time of a plurality of kernel modules loaded through a plurality of threads <NUM>-<NUM>, <NUM>-<NUM>,. , <NUM>-n in a second stage <NUM>. In operation <NUM>, the processor <NUM> may restructure the kernel module groups based on the load time of the plurality of kernel modules.

According to various embodiments, in operation <NUM>, the processor <NUM> may perform parallel loading based on the restructured kernel module group in a next boot. The processor <NUM> may improve the kernel module load speed through restructuring the kernel module group. Even if the load speed of a predetermined kernel module is delayed compared to the load time of a kernel module group used in the initial boot depending on a state of the electronic device <NUM>, the processor <NUM> may stably maintain the load speed of the kernel module based on the state of the electronic device <NUM>.

<FIG> is a flowchart illustrating an operation of an electronic device according to various embodiments.

Referring to <FIG>, according to various embodiments, in operation <NUM>, a processor (e.g., the processor <NUM> of <FIG>) may receive a plurality of kernel module groups generated based on dependency among a plurality of kernel modules.

According to various embodiments, in operation <NUM>, the processor <NUM> may perform parallel loading on the plurality of kernel modules based on the plurality of kernel module groups.

According to various embodiments, in operation <NUM>, the processor <NUM> may generate a restructured kernel module group by restructuring the plurality of kernel module groups based on the load time of the plurality of kernel modules.

According to various embodiments, the processor <NUM> may perform parallel loading again on the plurality of kernel modules group based on the plurality of kernel module groups. The processor <NUM> may measure the load time of the plurality of kernel modules. The processor <NUM> may generate a restructured kernel module group by restructuring a plurality of kernel module groups based on a load time.

According to various embodiments, the processor <NUM> may integrate a first kernel module group with a second kernel module group among the plurality of kernel module groups based on the load time. The processor <NUM> may measure load times of the first kernel module group, the second kernel module group, and a third kernel module group among the plurality of kernel module groups. When the load time of the third kernel module group is greater than the load time of the first kernel module group and the load time of the second kernel module group, the processor <NUM> may integrate the first kernel module group with the second kernel module group.

According to various embodiments, the processor <NUM> may generate a kernel module group by separating at least one kernel module group based on the load time. The processor <NUM> may measure load times of the first kernel module group and the second kernel module group among the plurality of kernel module groups. When the load time of the second kernel module group is greater than the load time of the first kernel module group, the processor <NUM> may generate a fourth kernel module group and a fifth kernel module group by separating the second kernel module group.

According to various embodiments, the processor <NUM> may restructure the plurality of kernel module groups using a dependency graph generated based on the dependency. The dependency graph may include nodes corresponding to the plurality of kernel modules and may include an edge connecting the nodes based on the dependency.

According to various embodiments, an electronic device (e.g., the electronic device <NUM> of <FIG>) may include at least one processor (e.g., the processor <NUM> of <FIG>) and a memory (e.g., the memory <NUM> of <FIG>) configured to store instructions to be executed by the processor, wherein the processor may be configured to generate dependency relationship data based on dependency among a plurality of kernel modules executed by the processor, determine a first kernel module to be loaded in a first stage among the plurality of kernel modules based on the dependency relationship data, and generate a plurality of kernel module groups by determining a second kernel module to be loaded in a second stage among the plurality of kernel modules based on the dependency relationship data and the first kernel module.

According to various embodiments, the processor may be configured to generate the nodes corresponding to the plurality of kernel modules and generate the dependency graph by generating the edge connecting the nodes based on the dependency.

According to various embodiments, the processor may be configured to determine the first kernel module to be a root node of the dependency graph and generate the dependency graph by connecting the second kernel module to a child node of the root node.

According to various embodiments, an operation of loading a kernel module of the first stage may be performed chronologically ahead of an operation of loading a kernel module of the second stage.

According to various embodiments, the processor may be configured to perform parallel loading on the plurality of kernel modules based on the plurality of kernel module groups.

According to various embodiments, the processor may be configured to measure a load time of the plurality of kernel module groups and generate a restructured kernel module group by restructuring the plurality of kernel module groups based on the load time.

According to various embodiments, the processor may be configured to integrate the first kernel module group with the second kernel module group among the plurality of kernel module groups based on the load time.

According to various embodiments, the processor may be configured to measure load times of the first kernel module group, the second kernel module group, and a third kernel module group among the plurality of kernel module groups and when the load time of the third kernel module group is greater than the load time of the first kernel module group and the load time of the second kernel module group, integrate the first kernel module group with the second kernel module group.

According to various embodiments, the processor may be configured to further generate a kernel module group by separating at least one kernel module group based on the load time.

According to various embodiments, the processor may be configured to measure load times of the first kernel module group and the second kernel module group among the plurality of kernel module groups and when the load time of the second kernel module group is greater than the load time of the first kernel module group, generate a fourth kernel module group and a fifth kernel module group by separating the second kernel module group.

According to various embodiments, an electronic device (e.g., the electronic device <NUM> of <FIG>) may include at least one processor, and a memory configured to store instructions to be executed by the processor, wherein the processor may be configured to receive a plurality of kernel module groups generated based on dependency among a plurality of kernel modules executed by the processor, perform parallel loading on the plurality of kernel modules based on the plurality of kernel module groups, and generate a restructured kernel module group by restructuring the plurality of kernel module groups based on the load time of the plurality of kernel modules.

According to various embodiments, the processor may be configured to perform parallel loading again on the plurality of kernel module groups based on the restructured kernel module group.

According to various embodiments, the processor may be configured to measure a load time of the plurality of kernel modules and generate a restructured kernel module group by restructuring the plurality of kernel module groups.

According to various embodiments, the processor may be configured to restructure the plurality of kernel module groups using a dependency graph generated based on the dependency.

According to various embodiments, the dependency graph may include nodes corresponding to the plurality of kernel modules and an edge connecting the nodes based on the dependency.

According to various embodiments, a method of loading a plurality of kernel modules in an electronic device may include receiving a plurality of kernel module groups generated based on dependency among the plurality of kernel modules, performing parallel loading on the plurality of kernel modules based on the plurality of kernel module groups, and generating a restructured kernel module group by restructuring the plurality of kernel module groups based on a load time of the plurality of kernel modules.

The electronic device according to embodiments may be one of various types of electronic devices. The electronic device may include, for example, a portable communication device (e.g., a smartphone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance device. According to one embodiment of the disclosure, the electronic device is not limited to those described above.

It should be appreciated that embodiments of the disclosure and the terms used therein are not intended to limit the technological features set forth herein to particular embodiments. In connection with the description of the drawings, like reference numerals may be used for similar or related components. As used herein, "A or B," "at least one of A and B," "at least one of A or B," "A, B or C," "at least one of A, B and C," and "at least one of A, B, or C," each of which may include any one of the items listed together in the corresponding one of the phrases, or all possible combinations thereof. Terms such as "1st," "2nd," or "first" or "second" may simply be used to distinguish the component from other components in question, and do not limit the components in other aspects (e.g., importance or order). It is to be understood that if an element (e.g., a first element) is referred to, with or without the term "operatively" or "communicatively," as "coupled with," "coupled to," "connected with," or "connected to" another element (e.g., a second element), it means that the element may be coupled with the other element directly (e.g., by wire), wirelessly, or via a third element.

As used in connection with embodiments of the disclosure, the term "module" may include a unit implemented in hardware, software, or firmware, and may interchangeably be used with other terms, for example, "logic," "logic block," "part," or "circuitry. " A module may be a single integral component, or a minimum unit or part thereof, adapted to perform one or more functions.

Various embodiments as set forth herein may be implemented as software (e.g., the program <NUM>) including one or more instructions that are stored in a storage medium (e.g., an internal memory <NUM> or an external memory <NUM>) that is readable by a machine (e.g., the electronic device <NUM>). For example, a processor (e.g., the processor <NUM>) of the machine (e.g., the electronic device <NUM>) may invoke at least one of the one or more instructions stored in the storage medium and execute it. The one or more instructions may include code generated by a compiler or code executable by an interpreter. Here, the term "non-transitory" simply means that the storage medium is a tangible device, and does not include a signal (e.g., an electromagnetic wave), but this term does not differentiate between where data is semi-permanently stored in the storage medium and where the data is temporarily stored in the storage medium.

According to one embodiment, a method according to embodiments of the disclosure may be included and provided in a computer program product.

Claim 1:
An electronic device (<NUM>) comprising:
at least one processor (<NUM>); and
a memory (<NUM>) configured to store instructions to be executed by the processor,
wherein the processor (<NUM>) is configured to:
generate dependency relationship data based on dependency among a plurality of kernel modules executed by the processor,
determine a first kernel module to be loaded in a first stage among the plurality of kernel modules based on the dependency relationship data, and
generate a plurality of kernel module groups by determining a second kernel module to be loaded in a second stage among the plurality of kernel modules based on the dependency relationship data and the first kernel module, wherein the dependency relationship data comprises a dependency graph constituted by nodes and an edge connecting the nodes, and
the processor (<NUM>) is further configured to:
generate the nodes corresponding to the plurality of kernel modules, and
generate the dependency graph by generating the edge connecting the nodes based on the dependency, wherein the processor (<NUM>) is further configured to:
determine the first kernel module to be a root node of the dependency graph, and
generate the dependency graph by connecting the second kernel module to a child node of the root node,
measure load times of the first kernel module group, the second kernel module group, and a third kernel module group among the plurality of kernel module groups, and
when the load time of the third kernel module group is greater than the load time of the first kernel module group and the load time of the second kernel module group, integrate the first kernel module group with the second kernel module group to form a new first kernel group, and
parallel loading the new first kernel module group and the third kernel module group.